It’s generally the same technique as can be found here (with imagemagick):
https://patdavid.net/2012/08/imagemagick-average-blending-files.html
Or here:
https://patdavid.net/2013/12/mean-averaged-music-videos-g.html
If you do this manually in GIMP you’ll want to bring all the stacks in as layers, and set the opacity of each layer as a percentage of the total number in the stack, from the bottom up.
So for 4 images, you can do:
25%
50%
75%
100%
But really, the easiest way is to just chuck them into imagemagick if you have many images and try median/mean blends.