The locks the JVM use to implement synchronized
are not operating system locks, but is implemented internally in the JVM.
This is for speed reasons as well as they lock something different. The operating system has no special understanding of Java objects (as opposed to files, memory and so on) so the JVM has its own locking mechanism specially designed for this.
A lot of effort has gone into making this very fast.