You have two options for tipping at a restaurant: Tipping in cash or including the tip on your credit card. (Notice that there is no third option to not tip at all. Don't be a cheapskate.) Is it better to tip with cash or with a card? That depends on the perspective involved.
From the viewpoint of the server or person being tipped, cash is generally preferred. That is not just because a less scrupulous server may skip reporting some cash tips as income and evade taxes. Merchants have to pay a small fee to the credit card company for each payment that is processed. Some restaurant owners deduct a portion of those fees from your server's tip, reducing the amount that you intended to leave for them.
There is also a time lag associated with the tips based on credit cards. The restaurant manager/owner must check the receipts and determine how much cash your server is owed for the tips on their shift. Servers may have to wait for some time after their shift is over to receive their tips, which can be troublesome if your server needs to be somewhere else quickly after work for a family obligation or second job. In other cases, the tips are added onto the paycheck, which can cause a cash-flow problem for your server.
Even a cash tip is not guaranteed to land completely in the server's pocket. Some restaurants pool the tips to distribute them among the other supporting staff (such as busboys). In that case, you really do not have any control over how much of your tip is directed toward your server.
Auto-gratuities that are added to larger bills are more complicated from the restaurant owner/server viewpoint, based on the rule starting in January 2014 that auto-gratuities are considered service charges instead of a tip. That puts them in the category of regular wages and the restaurant must report them for payroll tax withholding.
From your viewpoint as the customer, how you tip generally does not matter, except when you are tipping on a service related to business purposes. In that case, the gratuity can have reimbursement consequences for you and tax consequences for your employer. Most employers have relatively strict guidelines on expectations for tipping and how they expect it to be documented.
From your employer's perspective, a tip is a deductible business expense, but problems can arise when the tip is disproportionate and/or non-documented. Generally, businesses prefer that tips be applied to credit cards so that they have a record of it, but most businesses have a means of accounting for cash tips in expense reports. If you keep the amount reasonable and follow your employer's system, then all should be well.
While we have used a restaurant as an example, these same principles can be applied to hotels, transportation, or any other place where a credit card can be reasonably used for a service tip.
As the customer, you can help your server in one of two ways: Either ask if cash tips are pooled and present all of your tips in cash so you can make sure that your server receives the amount you intended to tip, or add an extra few percent to a credit-based tip. If you have ever worked as a server or in a job based on tips, you will know how grateful your server will be that you took the time to make sure that he or she was well compensated for their work.