The New York Times Magazine published a deep dive into the origin story of Dobbs. It covers a lot of ground, and based on my own recollection, it is fairly accurate. Here, I'd like to highlight a few items.
A lead protagonist in the story is former Wisconsin SG Misha Tseytlin. Misha may not be a household name, but he has been extremely influential over the years. For example, he was the brainchild behind the Obamacare challenge that became known as California v. Texas. (See profiles from the Houston Chronicle and Vox.) Earlier, at the West Virginia's Attorney General's Office, Misha helped develop some other influential cases that did not get as much press. More recently, Misha played an important role in the road to Dobbs. Shortly after the 2016 election, Misha began to develop an idea to target Roe: states should pass a fifteen-week abortion ban. This approach would allow the Court to eliminate the "viability" line, but would not require the Court to overrule Roe and Casey.
Now Tseytlin posed a theoretical question, according to people familiar with the discussion: What would happen if a state tried to pass an abortion limit at, say, 15 weeks? A slightly earlier restriction could force the court to examine the viability rule — and shake the very foundations of Roe. Could they push the number of weeks back just to the point at which their opponents would challenge it?
Tseytlin had a hard time believing that Chief Justice John G. Roberts Jr. or Kennedy, who had come to inhabit a role as the court's swing vote, would strike down a ban that was just a few weeks earlier than 20. Many restrictions in Europe were drawn at 12 or 15 weeks.