In tv-shows like Rome, the slaves sometimes show extreme loyalty to their owners, often saying things like "if you die, i will kill myself." Were the slaves really this loyal? If so, why?
As with any other group of humans, individual attitudes and beliefs differ with each individual. Some slaves were perfectly loyal, some...not so much. For example, Plutarch tells us that Antony's slave Eros had been ordered by Antony to kill his master lest he fall into Octavian's hands, but couldn't bring himself to kill his master and instead turned the sword on himself. On the other hand, escaped slaves are quite frequently mentioned in Latin literature, as is the word profugus, which literally means a fugitive but is mostly used to describe escaped slaves or to invoke the idea of the subject (such as the wandering epic hero) being like a fugitive slave. And of course many of the fighters in the Third Servile War were escaped slaves, although not all.
A distinction must be made, however, between household slaves and laborers. A slave in the fields might never see his master if he was owned by a man who held multiple estates. A household slave was, well, a member of the household--Latin familia does not mean "family" in the modern sense, in that it does not describe relatives but all those living under your house, and especially your slaves. In fact, familia by Cicero's day pretty much exclusively meant your slaves, particularly those who lived in your household. It often, though far from always, implies affection, of the sort that the modern word "family" implies, and it pretty much always at least implies intimacy (they're living with you every single day, after all). Even within the household slaves there might be a choice few even closer to their masters, particularly secretaries or other assistants like Tiro. Tiro brings up several other considerations. Tiro was probably born in Cicero's grandfather's house, a few years after Cicero, and he grew up alongside Cicero, who valued him greatly as both a secretary and a friend. Like many household slaves, Tiro was manumitted by his master (in Tiro's case before his master's death) and the bond between them was quite close. Slaves of this sort were often quite close to their masters.
Of course, this was not always the case, even among household slaves. Seneca 47 has a famous discussion on the treatment of slaves, in which he says that from a Stoic's point of view slaves are little different than free men, in that we are all humans and we will all meet the same end--the letter contains the famous line:
'Servi sunt.' Immo homines. 'Servi sunt.' Immo contubernales. 'Servi sunt.' Immo humiles amici. 'Servi sunt.' Immo conservi, si cogitaveris tantundem in 5 utrosque licere fortunae.
Some say 'They are slaves!' No, rather they are men. 'They are slaves!' No, they are comrades [literally tent-mates, conterbernales is a military term that implies a very close bond]. 'They are slaves!' No, they are humble friends. 'They are slaves!' No, they are our fellow-slaves, if you consider each of us is equally in the hands of Fortune.
Now Seneca here is specifically talking about household slaves here, because when he mentions the mistreatment of slaves it's always in terms purely of the household--the slave forced to acquiesce to the sexual desires of his master, the boy forced to hold the water pitcher, or slop up the mess at dinner, or carve up the meat. Presumably Seneca had no problem with treating slaves in the fields or mines as beasts of burden. But the point is that we can't characterize master/slave interactions in general, it depended entirely on the slave and the master in question. Claudius' slaves and freedmen were devoted to him, and Sulla trusted his household enough to let them deal with much of the running of the proscriptions (for which they were hated, since their corruption is what made the proscriptions so much worse). On the other side, it was not unknown for slaves even to murder their masters--the fact that Roman law had such fierce prohibitions against it shows that it was at the very least a fear that weighed heavily on everyone's mind. But even harshness might not be an insurmountable obstacle. Cato was, like his grandfather, famously strict towards his slaves, but even so there was clearly a close bond between them. Plutarch says that while in Africa, shortly before killing himself, he punched one of his slaves in the mouth hard enough to bruise his hand--but the blow was prompted by the fact that his slaves refused to tell him where his son had hidden his sword, because they did not want to let him kill himself.
The bottom line is that while some slaves, yes, were clearly very loyal to their masters, either through good treatment or just the intimacy that constantly living with their masters created, others might not be. It's not something that we can easily generalize about