the teas are not made with cocaine, they are made with coca leaves. These leaves have wonderful natural medicines that help you with the altitude, and when you are lost, and you have no things to eat, these leaves work as a good nutritious source. The cocaine, is made up of cocaine leaves, with more ingredients, an it is a drug.
The thing of the altitude means that when you get in high elevations like Machu Picchu, there is less air particles to breath in, so your chest starts to hurt, and it can be really serious if you exercise in high places, the coca leaves, reduce this pain, and you can either chew, or drink in a tea, this coca leaves, but they are very different from the drug, so don't get confused about that.