Yep, HitMaker has it. Airplanes need *airspeed* to fly - their speed on the ground ('groundspeed') has nothing to do with flight.
The reason why planes take off into wind is because of runway length. For example, say you need 70kts of *airspeed* to fly, and the wind is 10kts.
If you take off directly into wind, the wind provides 10kts of airspeed without having to accelerate down the runway at all. So, if you are traveling at 60kts down the runway into wind, you actually have 70kts of airspeed and you can take off.
But if you are taking off 'downwind', you need to be going at 10kts on the ground before you get ANY airspeed whatsoever...think about it and it is easy to understand. So to fly you would need 10kts on the ground to get zero airspeed, plus the extra 70kts to fly. So to get 70kts airspeed downwind, you would need to travel at *80kts* down the runway.
Why bother to accelerate to 80kts if you can take off the other way at 60 kts? What if something went wrong as soon as you took off? If you were taking off as you passed 60kts, you probably have enough runway left to land. If you took off at 80kts groundspeed, you might not have any runway left. Besides, by climbing into wind, you get to climb steeper and can clear obstacles (e.g. mountains) with less distance covered on the ground. Much safer.
Taking off / landing into wind is most critical when the runway is only slightly longer than the minimum needed. Remeber the required runway length is increased anyway when the runway is damp or flooded, snowy, iced over, made of (long) (wet) grass or boggy ground, covered in leaves, etc .... why make things harder for yourself?
By the way, if the wind was stronger than the airspeed needed to fly, then a plane could, in theory, take off backwards.
Hope this helps.