system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do flying bugs just somehow appear around left out food, almost like the food itself birthed them?
gpt
Flies smell rotting organic material (food/animal dead bodies/and animal excrement) are attracted to it by instinct (pre-programmed in their dna - just like you are pre-programmed to like sugary foods).

&#x200B;

The flies themselves are mature/adults and do not eat, but they lay eggs on or in said rotting food/dead animal/animal pooh. The eggs hatch and their larva (also known as maggots) eat said organic matter and then form a hard shell around them called a pupa, where they metamorphosis (change body type) like butterflies do into flies.

&#x200B;

They find a mate upon emerging from their pupa and repeat the cycle.

&#x200B;

If you find flies in your house, they likely came in when you walked in the door, or through a crack in the floor/wall/ceiling/air-duct in their search for a place to lay eggs.