A very rough summary of events in chronological order as best as I know them rather than events as shown in the series:
Centuries ago a woman named Ymir gained the power to become a Titan. Between her and her followers emerged nine shifters and the knowledge of how to make the stupid titans we've seen throughout the series. They made life hell for those around them as they took over lands.
Only those descended from this original Ymir's race can become, and it seems those specifically descended from her have special powers while Titanized in Titan form.
The nine known shifters:
A shifter can combine powers by eating another shifter. Ehren currently has the Attack and Founder Titan powers.
A normal mindless Titan who eats a shifter regains their mind and gains that shifter's powers along. What happened with our Ymir.
A Titan/Shifter who eats a shifter gains some of that shifter's memories.
Time passes. Technology improves. The Titans are powerful, but as we've seen all series they aren't infalliable. Swords, bodies, etc. and you can bring them down. Imagine canons, guns, more modern artillaray.