You're arrested, and you have no idea why. You don't believe that the police had any reason to arrest you, and you think it was illegal.
You may be right. Police typically cannot make an arrest without some type of probable cause. This is granted by the Fourth Amendment, and it means that justification has to be given.
In short, police need to know in advance that there is a reason to arrest you. They can't arrest you first and then look for a reason, even if that reason winds up being valid.
The trouble with probable cause is that it's pretty vague. This was done on purpose because many cases are different, but it does mean there is a bit of a gray area where you may think the police didn't have probable cause and they may argue that they did.
Of course, even if the police do have probable cause, that doesn't establish guilt. It just means that the police are suspicious and have a valid reason to be so, and they can then start their investigation.
This is an important note because innocent people do get arrested. Don't assume that the police have broken the law just because you didn't do anything wrong. It could still be a legal arrest.
If they don't have a reason to arrest you, though, that's when your rights may have been violated. The United States was never intended to become a police state where the authorities can act without reason, and you need to know all of the legal options that you have after being arrested.
Source: FindLaw, "When is an Arrest a Legal Arrest?," accessed Sep. 19, 2017