The ulnar nerve originates from the brachial plexus and passes behind the medial epicondyle of the humerus at the elbow before entering the palm of the hand. It is commonly injured at the elbow, where it lies behind the medial epicondyle, often due to fractures of the medial epicondyle, and at the wrist, where it is superficial and vulnerable to cuts and stab wounds in front of the flexor retinaculum. The document provides details on the anatomical course and sites of potential injury of the ulnar nerve.