Open-drain microcontoller ports
Ignoring the ins and outs of how mosfets work. The output acts like a switch to ground. It cannot produce a high (+5V) signal by itself. The pull up resistor is used so that when the switch is open the output will be high. When the switch is closed the output will be low (0V)