There are many different factors that can cause a piano to go out of tune. Here are a few:
1. Playing it: Although it is designed to maintain its pitch while being played, daily playing will cause enough strain on the strings that it will put it out of tune. You may or may not even notice it, which is why it's good to have it tuned every 6 months.
2. Not playing it: Even a piano that sits untouched for periods of time will go out of tune. The piano is built to hold up to 22 tons of tension when all the strings are pulled up to pitch and with this high tension, strings are very susceptible to any slight change in humidity and temperature change.
3. Humidity: As the moisture content in the piano changes from season to season due to humidity, the strings are stretched tighter in a humid environment, or allowed to relax in a drier climate. Humidity control devices on your piano can help decrease this change to the tuning, but a piano will still need regular attention (6 months - 1 year) to maintain proper pitch.
4. Moving a piano: The moving alone will affect the tuning, but also being in a new environment can affect your pianos sound. A store or home from where a piano is purchased can have different temperature or humidity conditions that will affect the tuning. A piano that is just been moved should be allowed to "acclimatize” for a couple weeks. Once the piano is allowed to settle into its new home, it will stabilize and hold a tune much better.
5. Temperature: Just as humidity and dryness affects your pianos tuning, so do warmer and cooler conditions. It is best to situate your piano where it won't be affected by direct sunlight, heat from a fireplace, or vents that can blow cold or warm air. In a newer well built home, putting a piano on an "outside" wall should not be a problem however, with older homes that have little insulation, an inside wall is preferable.