I've had back pain off and on for years. Why does it keep coming back?

Because U are alive. Back pain is one of the most common experiences of being human. When it happens, being aware of what you did how and avoiding it in the future is called learning. Many factors can cause or contribute to back pain. Some are serious and must be considered, but the vast majority of causes are mechanical. See a doctor who is also a mechanic academyofosteopathy. Org has a doctor finder 4 one near u.
Inactivity/activity. I had back surgery in 2011, and I worked my butt off to come back as much as possible to my previous condition. I exercise everyday but I am a lot more cautious with my activities. Inactivity or activity can contribute to your inconsistent symptoms. Maybe you need physical therapy to help train you in what you should and should not do.