DCGAN is initialized with random weights, so a random code plugged in the network would make a totally random image. However, when you may think, the network has a lot of parameters that we can easily tweak, and also the aim is to locate a placing of those parameters which makes samples created from random codes seem like the teaching knowledge.