The Underground Railroad wasn't actually a railroad. It was a name for a way that slaves escaped. No one is sure where it got its name, but the "underground" part of the name comes from its secrecy and the "railroad" part of the name comes from the way it was used to transport people.
Of course, it was very dangerous. Not only for the slaves who were trying to escape, but also for the people trying to help them. It was against the law to help escaped slaves and, in many southern states, conductors could be put to death by hanging.
In 1850 the Fugitive Slave Act was passed in the United States. This made it a law that runaway slaves found in free states had to be returned to their owners in the south. This made it even more difficult for the Underground Railroad. Now slaves needed to be transported all the way to Canada in order to be safe from being captured again.