At a frequency of 37.5 kHz a quarter wavelength is about 2 km long. How does the black box efficiently radiate anything if it is not attached to 2 km of antenna?
The short version of the answer is
Specifically, the 37.5KHz "pinger" tones used in the Underwater Locator Beacons that are bolted onto Cockpit Voice Recorder / Flight Data Recorder "black boxes" are in the low end of what we call ultrasonic frequencies. Water is generally a good conductor of sound (with at least one notable exception), so it is usually possible for sonar detection equipment to "hear" the pinger tones at reasonable distances (with the interpretation of "reasonable" varying based on the depth of the area being searched - much like in air the sound intensity falls off as distance from the source increases, so if we're listening at the surface of the ocean a pinger in 500 feet of water will have a larger coverage footprint than the same pinger in 5000 feet of water).