The use of audio recorders to capture spirit voices, known as EVPs (Electronic Voice Phenomena) can be traced back to the late 1950s when Friedrich Jürgenson used his cassette recorder to record the sounds of birds in his garden. Upon re-playing the audio, he heard voices that he didn't remember hearing at the time, believing them to be voices of the dead. (Others who reviewed similar audio believe he may have been mistaking bird calls for human voices and words.) Regardless of what it was that he actually heard, a new field of spirit communication was born, but by no means was this a new concept: in the 1920s, Thomas Edison himself dabbled with a device he called the Spirit Phone, although it never led to anything conclusive, and the failed experiment wasn't shared much publicly. Today, ghost hunters continue to use voice recorders to try and capture voices and messages from the dead, typically via digital voice recorders.
Digital Voice Recorders
Digital voice recorders record sound and then store it on the device as a file which can be replayed instantly or uploaded to another device, like a computer. In the world of ghost hunting, these are used to not only verbally document any activity that someone might experience and when/where they experienced it, but they are also used to try and communicate with the dead in a method known as burst EVP sessions: this is when the ghost hunter will ask a series of questions out loud to any spirits that might be present, and then listen back to the audio for possible spirit responses. One theory as to how this could work can be explained through a study on sounds audible to us: humans can hear up to 20 kHz, with most microphones maxing out at 24 kHz, so not much of a difference. However, researchers during one study produced a sound inaudible to humans at 40 kHz+ that was still somehow audible to microphones. The sound was made using multiple tones which interacted with the microphone's mechanics, creating a "shadow" - a sound that the microphone could detect and that we could then play back and hear for ourselves. If this is possible, perhaps spirit voices interact with voice-recorder mechanics in a similar way...
Pareidolia can effect how we hear things, which in this case is sometimes referred to as audio-matrixing. (Think of the yanny and laurel audio that went viral.) This can greatly effect what we might perceive as spirit voices, but could be any number of sounds that our brain interprets as familiar words. Here are some more in-depth reads on the study of EVPs worth taking note of:
A spirit box, also sometimes called a ghost box, is a device that rapidly scans AM and FM radio stations which produces a white noise effect. The SBox Ghost Box and the SB7 Spirit Box are two of the more popular versions on the market. It is theorized to work in a few different ways: some believe that spirits can more easily communicate with is using these radio wavelengths. Others believe that the energy produced by these devices can be used by said spirits to make communication easier. And lastly, some believe that spirits can pick from or influence the bits of words and sounds coming through the radio stations to form the message they want to get across.
Pareidolia can make using a spirit box tricky as you might hear what you want to hear. But paranormal investigators Karl Pfeiffer, Connor Randall, and Michelle Tate devised an experiment that would help to rule this out: while investigating at the Stanley Hotel in Estes Park, Colorado, they isolated the noise of the spirit box by using noise canceling headphones. Someone externally would ask questions to any spirits that might want to communicate while the person listening to the spirit box verbally states any words or phrases they heard from the device, not knowing what is being asked. This usually resualts in one of two things: nonsense words being spoken by the listener that don't relate to any questions asked, or you can end up with quick and intelligent responses to the questions that you can feel confident in, knowing that the person listening to the spirit box did not know what was being asked. (I have personally had great success with this method and highly recommend it!)
Other ITC Devices
There are always new devices hitting the ghost hunting market to aid in spirit communication. Most of these are referred to as an ITC (Instrumental Trans-Communication) device which is essentially any video or audio device that is used to try and communicate with the spirit world. The Ovilus is another good example of an ITC device: it contains a word bank and produces words on the screen of the device that are generated and determined by fluctuations in the surrounding environment. This could be temperature changes, changes in EMF (electromagnetic fields), humidity, barometric pressure and more. The Paranormal Puck is another device you might see on TV which functions similarly. Note that these devices produce words regardless of whether a spirit is present, and that pre-loaded word-banks can sometimes be filled with the types of words you would expect to hear at a haunted location: words like death, spirit, grave, and they will have common names like John and Sara. This makes the device more likely to produce "relevant" words while being used at a haunted location. Use your best judgement, and look for other corresponding activity to help solidify your results.