Not quite how it happened.
Yahoo banned porn on Tumblr because Apple found a CSAM image on their platform, banned their app from the App Store, then as a condition for unbanning the Tumblr app, issued them an ultimatum to outright ban pornographic content. I originally thought that Yahoo's justification was an excuse they used because they couldn't be bothered to invest the resources needed to purge illegal content from their platform, but apparently Discord have been hit with similarly puritanical demands from Apple and Google, who basically have a monopoly on what apps go on your smartphone,
Nevertheless, Tumblr's porn exodus is the core reason why Yahoo sold the platform to Automattic for pennies compared to how much they originally acquired Tumblr for. It even sparked a renaissance of lewd artists flocking to Newgrounds - a site that was originally on its knees due to the death of Flash animations and browser gaming.
It's also worth noting that Automattic have since partially dialed-back the ban. Nudity is allowed on Tumblr again, but graphic sexual content isn't. Obviously they did this in direct response to Elon Musk enshittifying Twitter. Another reason I think Tumblr is living on is because it was known for three things: porn, niche fandoms and social justice warriors. Musk has notably burned bridges with any Twitter users who oppose hate speech.
God forbid if Tim Cook and Sundar Pichai find out there's porn on Reddit....