Explanation needed on using 2 transistors as a switch
If the digital signal swing is the full 5 V, then you can use just the final P-channel FET.

The advantage of the two-transistor circuit is that the power voltage being switched and the digital signal power voltage don't need to be the same.  The circuit you show would work with the power voltage being up to the maximum G-S voltage the second FET can handle.