The world hates those who side with Jesus. He gives the reason in v. 19. The reason is because the world loves all those who are its own. Like likes like. The world tolerates all those who conform to its value system.
Unredeemed humanity is the world.
If you belonged to the world, it would love you as its own. As it is, you do not belong to the world. We do not belong to the world. We do not belong to this world. We are passing through.