If you cross the border without authorisation, you are breaking the law of two countries. The one you are leaving and the one you are entering. For this reason, you will not be arrested, but detained by the police until you pay a fine of around 300 euros.
There are not too many controls, but occasionally there are police officers at certain points along the way who will ask you for your documents.