AV Mode changes the aperture setting of the camera. The lower the aperture, the shorter the depth of field. So the background comes out more blurry than the main subject. The skull sitting ontp of the fire hydrant is in focus while the building is blurred out behind it.
With a high aperture, a large depth of field is used. So everything stays in focus, the way it did in this photo.