It's neither a bacteria nor a virus, it's a type of parasite. It burrows into the fish, feeds, and then drops off to complete it's life cycle. When you treat ich in a tank you're not treating the ich ON the fish, as in that stage it's not vulnerable to meds. You are treating the parasites that have fallen off the fish to prevent any parasites from reinfecting your fish. That's why you must treat ich for several days. You must treat it until your fish show no more signs and then for several days afterward to be completely sure that it's gone.
As ercnan mentioned, ich completes its lifecycle faster at higher temperatures. So higher temperatures will allow the parasite to drop off your fish faster. Once they fall off they are vulnerable to the meds.
There is another method of treating ich with salt and heat that involves adding enough salt and enough heat to kill the ich. Ich is sensitive to both salt and heat and can only handle certain amounts. However, there is some scrutiny of this method as it severely stresses most fish.
Personally I prefer raising the temperature to no more than 80 and treating with actual meds rather than salt, but many people prefer a lot of heat and salt for treatment. My fish seem less stressed going through normal treatment at lower temps than lots of heat and salt, so it just depends on what you are comfortable with.
Also keep in mind what fish you keep. Scaleless fish are sensitive and can die from some meds, especially those containing malachite green. So on some tropical scaleless fish, such as clown loaches, most choose salt and heat rather than meds.
There are some fish that barely tolerate salt or can't tolerate much heat, so the salt/heat method could potentially be fatal for them.