The primary function of kidneys is to filter blood and remove waste products and excess substances from the body, producing urine. While kidneys do help regulate blood pressure indirectly through the renin-angiotensin system, their main purpose is waste removal and filtration, not blood pressure control directly.