According to Wikipedia, hair transplantation is a surgical technique that moves individual hair follicles from a part of the body called the donor site to the bald or balding part of the body known as the recipient site. It is primarily used to treat male pattern baldness.
In this condition, grafts containing hair follicles that are genetically resistant to balding are transplanted to bald scalp. It is also used to restore eyelashes, eyebrows, beard hair, chest hair, and pubic hair and to fill in scars caused by accidents or surgery such as face-lifts and previous hair transplants. Hair transplantation differs from skin grafting in that grafts contain almost all of the epidermis and dermis surrounding the hair follicle, and many tiny grafts are transplanted rather than a single strip of skin.

Since hair naturally grows in follicles in groups of 1 to 4 hairs, transplantation takes advantage of these naturally occurring follicular units. This achieves a more natural appearance by matching hair for hair through Follicular unit transplantation (FUT).
Follicular unit transplantation (FUT) is a hair restoration technique, also known as the strip procedure, where a patient’s hair is transplanted in naturally occurring groups of 1 to 4 hairs, called follicular units. Follicular units also contain sebaceous (oil) glands, nerves, a small muscle, and occasional fine vellus hairs. In follicular unit transplantation, these small units allow the surgeon to safely transplant thousands of grafts in a single session, which maximizes the cosmetic impact of the procedure

It takes around six months before you can see significant changes in hair growth. The complete results of the transplant will be visible after a year. In most cases, a hair transplant will last a lifetime because healthy hair follicles are transplanted into thinning or bald areas. Hair transplants are a treatment option for hair that is visibly thinning. The results of a hair transplant are considered permanent because you cannot undo them.

Is it painful doing a hair transplant?
A hair transplant is usually carried out under local anesthetic and sedation, which means you’ll be awake but will not feel any pain.

The transplanted hair may also thin over time, just like the normal hair. You will need a surgical “touch-up” after the transplant procedure to create more natural-looking results. These will be done weeks after your initial cuts have healed. Some individuals may need multiple attempts to have a head full of hair.