how can autoencoder reduce dimensionality?
Autoencoders are trained using both encoder and decoder section, but after training then only the encoder is used, and the decoder is trashed.

So, if you want to obtain the dimensionality reduction you have to set the layer between encoder and decoder of a dimension lower than the input's one. Then trash the decoder, and use that middle layer as output layer.