A surface relief hologram, like the ones you find on credit cards, has a rippled surface with ridges and troughs spaced 0.5 microns to a few microns apart. In order to produce a 3D holographic image, a piston display "only" needs to duplicate those ridges and troughs. Actually, it's not trivial to design a binary "high/low" surface that does a good job of producing the same image as a laser-recorded hologram whose surface height varies continuously. If you would like to understand this in depth, you can start by developing an understanding of Huygens' Principle.
Edit 12/11/18: The type of hologram you're asking about is a "binary hologram". There are many, many explanations of binary holograms online, but this is a good one. The basic idea is this: diffraction angles are controlled by the spacing and orientation of grating lines. When a grating is "clipped" to make a binary grating, the spacing and orientation are not changed. Effectively, higher spatial frequency components are added to the grating by doing the clipping. Those higher-frequency components diffract light through larger angles than the original grating, so diffracted light due to the high frequency components is not visible at the angle of the image produced by the unclipped grating.