Medical malpractice occurs when a healthcare provider deviates from the accepted standards of practice in the medical community, injuring or harming a patient.