What makes food like biscuits last in supermarkets probably is the ingredients. There are certain ingredients added that can help extend the shelf life of foods, allowing them to be kept longer. Also biscuits are relatively dry and bacteria would grow more easily on foods with a higher water content.
Biscuits have naturally long shelf life.
It’s a simple case of osmosis. Biscuits start out dry and crunchy, and as they come into contact with the air around them, they absorb some of the moisture, and over time become softer and even soggy. This is a stale biscuit, and stale biscuits are friends to no-one. (If you accidentally leave a biscuit out in the open without eating it (unlikely, we know) and it goes a bit soft and soggy, you can pop it into the oven on a very low heat (around 50C) for 15 mins or so and it will go crunchy again. However the icing may discolour).
By putting biscuits in airtight or near airtight packaging, osmosis is stopped in it’s soggy tracks, and the moisture can’t get at the biscuits. This extends the shelf life from a week or two, to 2 or 3 months.