If a firm's price is below its average total cost, it loses money every time it produces a good or service. So why would it stay open?
If the firm's price is below ATC but above AVC, it should stay open because it loses LESS money by staying open than by shutting down. It still loses money, but it loses less money by staying open.
Consider the following example. Let's say the average fixed cost of a motel room (insurance, taxes, etc) is $50 per night. Let's also say that the average variable cost per night (paying the maid, the electricity, etc) is $45 per night. Finally, let's say that the price of the room is $50 per night.
What happens if the hotel stays open? Each room it rents out costs it $95. It gets back $50. So it loses $45.
But what happens if it closes? It still has the average total costs to pay. So it loses $50 per room per night.
So the reason for what you describe is that fixed costs continue to exist even if a firm shuts down. So when price is greater than AVC, the firm is at least losing less money than it would by shutting down.