While low wavelength light waves are unable to diffract around the dense vegetation, the high wavelength sounds produced by the elephants have sufficient diffractive ability to communicate long distances. The typical prey of a bat is the moth - an object not much larger than a couple of centimeters. Bats use ultrasonic echolocation methods to detect the presence of bats in the air. The answer lies in the physics of diffraction. As the wavelength of a wave becomes smaller than the obstacle which it encounters, the wave is no longer able to diffract around the obstacle, instead the wave reflects off the obstacle.
Bats use ultrasonic waves with wavelengths smaller than the dimensions of their prey.
These sound waves will encounter the prey, and instead of diffracting around the prey, will reflect off the prey and allow the bat to hunt by means of echolocation. Refraction of waves involves a change in the direction of waves as they pass from one medium to another. Refraction, or bending of the path of the waves, is accompanied by a change in speed and wavelength of the waves. Thus waves passing from one medium to another will undergo refraction. Refraction of sound waves is most evident in situations in which the sound wave passes through a medium with gradually varying properties.