How quantum entanglement explains the law of attraction