The system in Spanish bars and café's is pretty straightforward. You sit at a table, someone comes to serve you, you order your drinks and maybe a snack, you call them over if you want more, you call them over to pay the bill and, when you've paid you go and do something else. Occasionally the person who serves the drinks will leave a chit to tell you what you owe but it's unusual to be expected to pay there and then though it does happen in busy cafés especially in tourist areas.
If you sit or order at the bar then you are generally expected to stay at the bar though it's quite normal to ask at the bar and then move to a table where the person will deliver your drinks etc. The difference is that there is usually a small extra charge if you are served at a table so ordering at the bar and then carrying your drinks to the table can be seen as being a bit cheeky. Even at the bar you settle your bill at the end of the session though, sometimes, if a place is busy, say in a late night music bar, they will expect you to pay as you order your drinks so you don't get lost in the crowd.
At events there is often a system where you go to a ticket desk, tell them what you want and they give you tickets for the drinks and take your money. You then go to the bar and hand over your tickets in return for the drinks.
Tipping is usually limited to the small change left over from a transaction - so if your coffee and beer costs 1.85€ then the 15 cents is the tip. If you prefer to pay on percentage then 5% is acceptable and 10% is generous.
It can all go hideously wrong of course the most common problem being to get the waiter/waitress back to provide you with a second round or to get them to take your money.