Here "hearts" refers to the desires of people. Alternate translation: "God understands your true desires" or "God knows your motives" (See: [[rc://en/ta/man/jit/figs-metonymy]])
This can be stated in active form. Alternate translation: "Those things that men think are very important are things that God hates" (See: [[rc://en/ta/man/jit/figs-activepassive]])