Brake fluid is a hygroscopic fluid, which means that it naturally attracts moisture from its surroundings. When the moisture reaches a certain level, it loses its compression qualities and may be dangerous to use.
The moisture content is what brake fluid testers are made for because they measure the level of moisture found in the brake fluid. They usually measure the moisture content via probes that get inserted into the brake fluid reservoir and give out readings in seconds. The readings are usually LED lights or via an easy-to-read LCD screen. The readings are what determines if the brake fluid can still be used or is due for replacement.
Also you can watch this video from YouTube: