Typically, the employer paid for passage across the Atlantic Ocean, in return for the servant agreeing to work for a specified number of years. The agreement could also be in exchange for professional training; after being the indentured servant to a blacksmith for several years, you would expect to work as a blacksmith after the period was over. During the 17th century most of the white laborers in Maryland and Virginia came from England this way.
In the United States, indentured servitude was abolished along with slavery when the Thirteenth Amendment to the United States Constitution passed in 1865.
In some modern employment contracts, an employer pays for employee training, and the employee agrees to stay for a year or repay the cost of the training. A related circumstance is called a signing bonus.