In the ancient Near East, and especially among ancient Israelites, kidneys were thought to be the seat of human intelligence. Indeed, the NIV Bible's “heart and mind” is actually a translation of the Hebrew “kidneys and heart.” For the ancients, a number of human organs were believed to have psychical functions, which were seen to be the center of one’s volition, conscience, and moral character. Thus, your kidneys could be troubled (Job 19:27; Ps 73:21), be “tested” by God (Jer 11:20), and even rejoice (Prov 23:16). The kidneys also instructed people (Ps 16:7), a concept known from Ugaritic texts, though Akkadian texts connected these abstract notions to the liver rather than the kidneys.
It is also interesting that in the process of embalming, the ancient Egyptians removed all the internal organs except for the kidneys and heart. Mesopotamian extispicy (i.e., the practice of examining animal entrails and predicting things about the future) attached great importance to the kidneys, albeit nowhere near as much as hepatoscopy (same thing but with the liver). The ancients saw omens in the outward appearance of kidneys. Attention was particularly paid not only to pathological changes in the appearance of animal kidneys (red, black, covered with bright spots or white streaks, enlarged) but also to anomalies.