Poor posture can strain the back, look unattractive, and cause pain in a variety of ways. Regardless of your motivation, this article will help you understand why poor posture can result in back pain - and what you can do to correct it.
How Forward Head Posture Results In Back Pain
Forward head posture, as shown in the left portion of the image above, is exceedingly common in the modern era with how much time we spend sitting.
One reason forward head posture is a problem is that it moves the center of gravity of the head and neck out in front of the spine (illustrated by the yellow dots above). In this position, the entire spine has to fight the torquing force of the head off-center to prevent the head from falling off the body. Contrasting this with the right portion of the image above, the center of gravity of the head is aligned with the spine - minimizing or even eliminating any unnecessary head-torquing forces on the spine.
Forward head posture can cause pain along the entire spine. When the head is rested forward, all spinal stabilizer muscles from the tailbone to the neck are strained to keep the rest of the spine straight. This includes the lower back, middle back, and upper back spinal erectors and multifidus muscles.
Muscle Strain From Posture Resulting In Back Pain
Another mechanism by which poor posture can result in back pain is via the excess muscle strain poor posture places on the back. Here's how: Hunched forward posture causes several back muscles to lengthen beyond their typical resting length - while under load. When muscles are lengthened under load for a long enough time, they inevitably develop trigger points, knotting, and constant tension that presents as pain in the body .
You might ask - what do you mean my back muscles are under load while slouching? By "under load" I mean your back muscles are engaged and fighting resistance while in a slouched position. The resistance/load the back is fighting is the weight of the shoulders, neck, and head pushed forward beyond their natural position as described in the first section.
Lower Back Pain From Poor Posture
The correct posture for the lower back is a healthy, natural, "S" shape. When this posture deviates too far in either direction (extended or flexed), pain is nearly inevitable.
Posterior Pelvic Tilt & A Common Associated Pain Pattern 
A flattened or rounded lower back is associated with posterior pelvic tilt and tension in the Gluteus Medius and QL muscles, while a hyperextended lower back is associated with anterior pelvic tilt and tight hip flexor muscles. It is important to understand which case you fall into to ensure the right correction path - consult a professional if need be.
Correcting Poor Posture
I am not immune to the problem of poor posture resulting in back pain - I write this article only an hour after doing several posture correction exercises this morning. If you sit at a desk for 8+ hours a day, these could potentially help fix poor shoulder, neck, and head positions and restore natural posture.
These movements are just what seem to work well for me - consult a professional before attempting these exercises.
1. Face Pull Posture Press
This exercise is an upper back and rear delt strengthening movement that builds strength in the muscles that hold your shoulders in a healthy posture. I have found myself walking a little taller and holding good posture longer after several months of doing this exercise. 2 sets of 15 reps with a light-to-medium resistance band is my preferred use case.
2. Bioenergetic Mid Back Opener
This is the excessive version of a simple principle - spend time in an arched back position to counteract the effects of sitting in a rounded back position. You can do this on the side of a couch, bed, or on a foam roller and bench as shown. I like to get 20 deep breaths in this position for 1-2 sets.
3. Chin Tucks
While standing, preferably in front of a mirror, use a hand to gently but firmly push the chin back for 10-15 reps. This greatly helps with the neck portion of poor posture resulting in back pain, which is an essential piece of the puzzle.
4. Neck Training
Neck training has accidentally helped my posture. What I've found from a few months of neck training is that having a strong, pumped-up neck naturally helps me walk around with my head physically a little higher. I also noticed that a lot of forward head posture is actually in part a result of weakness in the neck muscles, and neck training has helped me hold good posture longer due to the increased strength and endurance.
How Can Poor Posture Result In Back Pain?
There are several ways poor posture can result in back pain, and I hope this article equips you with knowledge and actionable steps to improve your situation. Read these next for more on how you can fix the muscles, and fix the pain:
 Donnelly, Joseph M. Travell, Simons & Simons Myofascial Pain and Dysfunction: the Trigger Point Manual. 3rd ed., Wolters Kluwer Health, 2019.
 Davies, Clair, and Amber Davies. The Trigger Point Therapy Workbook: Your Self-Treatment Guide for Pain Relief. 3rd ed., New Harbinger Publications, Inc., 2013.