You can see an interesting short video of live rats moving away from a ultrasonic repellent installed area. The rats get irritated on continuous exposure to high pressure ultrasonic sound within 20KHz to 50 KHz and gradually move away where there is no ultrasonic sound.
Kindly note, rat do not get harmed or killed in this process. It is humane method to keep them away from our premise.