The short answer: dirt and sweat.
Moisture from sweat, saliva, and wet hair can cause yellow stains on your pillow.
The moisture from your oils and lotions can also yellow your pillows over time.
In general, there’s not much you can do about yellow stains. That’s why it’s important to wash your pillows regularly.
You may be tempted to bleach yellow stains. But bleach can ruin your delicate pillows, especially the filling. It also increases the chances of your pillow shredding and tearing. Avoid bleach and use gentle detergents instead.