There are some areas of the law where the exact definitions of words are not clear. The areas of the law that surround the concept of being detained are one such area. An officer may detain you if they suspect that you are involved in the crime but they’re not arresting you for it yet. For example, if they find you in somebody’s yard in the middle of the night and you have no good reason why you should be there, they may detain you for a few minutes to check to see if you have warrants out or to investigate what’s going on. When they detain you in this way, you are generally not free to leave on your own.
When you are arrested, you are formally being charged with a crime. This means you are absolutely not free to leave on your own and that you will likely be booked, searched for weapons and kept in custody for a time. You may also have to pay bail to get out of custody before you are brought before a judge. Being detained is not this formal. Oftentimes, the severity of being detained depends upon exactly what the circumstances surrounding it are.
For example, if you are nearby when a minor altercation happens, the police officers that show up to break it up may want to detain you for a few minutes to ask you what happened. You’re not being arrested but you are expected to wait until the officer gives you permission to leave. If you are being detained, it’s always acceptable to ask the officer if you may leave or whether they intend to charge you with a crime or not. Agencies other than law enforcement can detain you, as well. As an example, if you are caught shoplifting at a store, the store security may detain you until the officers arrived to arrest you.