Remember also that they offer a Pro version that costs money, and that they restrict the use of the free version to companies that make less than $100k per year.
There are a lot of people wanting to get into game-making these days, since tools have gotten better and the indie market has proven its worth. It's telling that Epic is putting even more emphasis on their tools than their games these days. In a gold rush, as it's said, the ones that get rich are the ones selling pickaxes.
The fact though is that you can publish commercially (even to mobile app stores) without a Pro license. The reason why making the base version free is commercially viable for them (aside from their hope that some users upgrade to Pro) is because of the success of their asset store.
Pretty much all Unity developers spend money on the asset store even if they're on the free plan. I myself have spent a few hundred dollars on the asset store of which Unity gets a cut thus allowing them to immediately monetize their free users.