Volume plays a good deal into the decision.
Mass markets are almost universally strip covers, which means that once they're in the stores, they never come back. Because of the cost of producing an MM relative to the cost associated with shipping it, bookstores "return" them by ripping their front covers off and sending just the cover back to the publisher. The books are then pulped.
While returns are also figured into the profit and loss calculation for a trade book, there is always the possibility of selling the returned stock later/using it to stock bookstore orders for a later promotion or when the stores want more stock on the author's backlist. With a mass market, 99.9 times out of 100, that book is gone forever once it's in the bookstore.
So you have to assume you'll sell through enough stock to make that worthwhile.
This week we got mass markets of Emma Donahue's ROOM for the first time since its publication...2?...years ago. She's coming out with a new novel, and her publisher thought now was the time to blow the money on that format.
Once in a blue moon, a mass market is not a strip cover, and once in another blue moon, a trade paperback is. HARRY POTTER and THE HUNGER GAMES are printed as strips--but again, expected sales volume.
Now, there are some genres, like sci-fi and romance, where the norm is to go straight to mass market, both because of customer price expectations and, I would assume, projected volume. If you can count on sell-through of a certain number of books just based on buying patterns of genre fiction readers, then (I think--I worked for a commercial NF imprint and we printed nothing in MM, ever) mass market saves on production cost.
It's all about that profit and loss statement.