By applying 'Z' you are telling the synthesis tool to use the io tristate buffer located just behind the pin for. It means you - the designer - are going to output from fpga(apply your drive) but at times you want the drive to be from outside(input) in which case the tristate will cut-off your internal drive.
For the above example:
a is driven from outside(input) then it drives b(output) when ctrl = '0' else
b is driven from outside(input) then it drives a(output now).
If the tool doesn't see this two drive case it will permanently enable the tristate buffer(output only) and then inout port is obsolete.
If you apply 'Z' to internal nodes(as opposed to output pins) then it is interpreted differently(as muxes).
another point is that you can apply 'Z' i.e. ask for tristate buffer without having inout but just out:
out1 <= '1' when .... else 'Z';
meaning you can cutoff drive so that an external pulldown(or pullup) takes over and hence equivalent to:
out1 <= '1' when .. else '0'; -- for the pulldown case.