The hardware internally doesn't use tristate signals, but your VHDL compiler
should be smart enough to turn...
pin <= 'Z' WHEN tristate ELSE '0' WHEN zero ELSE '1';
...into an instantiation of a tristate IO-buffer on an external "pin" which can high-Z. Sometimes the logic isn't that trivial, though, and you (as a programmer) might not realize that your code actually prohibits the pin from going 'Z'... (or you've confused the VHDL compiler).
Better stick to something explicitly simple as the code above, or directly instantiate a bidirectional I/O pin from your chip vendor's VHDL library:
the_pin: IOBUF port map (
T => tristate, -- '1' == high_z
I => data_out, -- data leaving the FPGA, may be tristated
O => data_in, -- data entering the FPGA
IO => pin); -- physical I/O pin