When I fly it is usually easier to make a stop, sometimes these stops can be quite short. Will an airline only sell two flights together if the transfer is do-able within the given time period?
No. But they'll try to aim for transfers which are possible.
The airline has some resources
If they give you a difficult transfer, e.g. your plane is late and you have 40 minutes to clear customs and security and get to your gate, they may send airline staff to intercept you and shortcut you to the front of lines and escort you to your connection.
They also have the ability to hold your connecting flight. They know how that will impact their operations, and work out the cost of doing this vs other options.
The airline owes you travel to your destination...
Even if you miss your connection, the airline must get you to your destination because the travel is booked on the same ticket. So they will route you onto other flights, or even other airlines (many of them have agreements for just this kind of situation).
So let us suppose you book Southwest LAX-MDW-LGA - LA to NY with a change at Midway airport. All on one ticket. The LA flight is late, and you miss the connection. Southwest will get you to LGA, no matter what it takes - the next plane, or two planes via IAD, Delta, Air Canada, whatever works.
... but only if you book on one master ticket/itinerary
Please note this does not apply if you buy separate tickets. Suppose you buy Southwest LAX-MDW because it's selling out, and you don't know whether your meeting is in Philly or NYC... then you find out, so you buy Southwest MDW-LGA. Different deal. If your first plane is late, you're outta luck. Southwest might be nice about it, but their choice.
Southwest would've cheerfully sold you LAX-MDW-LGA. Ryanair will not. Some discount carriers absolutely refuse to sell connected flights like that; they would only ever sell you LAX-MDW and MDW-LGA a-la-carte. This forces you into this latter situation, where they are never responsible for connection problems, and you always are. Watch out for that.