When you ad lib something, you make it up as you go along. You might attempt to ad lib your part in a play instead of memorizing your lines, with disastrous results.
Rap musicians sometimes ad lib, or freestyle, improvising their lyrics with no advance preparation. Improv comedy is all about the ability to ad lib lines based on what other performers are doing. The phrase ad lib is a shortened form of the Latin ad libitum, "at one's pleasure," or "as much as one likes," combining ad-, or "to," and libitum, "please" or "pleasure."