Every object, i.e., every object that extends Object, get associated with a
"wait set", which is a set of threads. This wait set is manipulated by the wait(), notify() and notifyAll() methods of the Object class. The JLS specifies that, as per
Java Thread scheduling mechanism, a thread can be added to a wait set of an object, only when the current thread holds a lock on the object. Meaning that, wait should be called for an object when the currently executing thread holds the lock on the object.
As to the reason of "Why" this is so, the programmers of Java might have experience problems with Thread scheduling mechanism, if the threads that call wait() on objects, did not own the locks on them.
Source:
JLS 17.14