As a general rule, though, you don't have to either stop, or talk. The driver of a motor vehicle has to produce identification on demand by a police officer, under provincial laws. Otherwise, there is no general right of the police to demand I.D. from someone who is just going about his or her business on the street. On the other hand, if you have committed a minor offence, providing proof of identity to the police will often mean you will not be taken under arrest to the station, so can be helpful to everyone. The police always have the right to question you.
Arrest is a step up from detention.
You can be arrested by a police officer any time you are found actually committing a criminal offence, or if there are reasonable grounds to believe you have committed or are about to commit an indictable offence, or if there is a warrant for your arrest. If you appear to have committed a serious crime, you can be held by the police until or unless you are ordered released in court, at a bail hearing. If you're arrested, the police can search you and the immediate surroundings, including a vehicle if you're in one. If you're not arrested, but detained temporarily for investigation, the police are probably within their rights to give you a pat-down or frisk search. At the very least a police officer is entitled to do a reasonable check to make sure you're not carrying a weapon.