You can see this in action by trying out any of these APIs in a browser that supports them. For example, most browsers now support Geolocation and will display a permission request when you launch this demo (unless you have already whitelisted the domain): https://developer.mozilla.org/en-US/demos/detail/urban-arter...
Camera capture in particular can only be initiated and controlled by the user -- it works just like the regular file upload dialog, but instead of a file picker dialog the browser shows a camera dialog. Just like file upload, camera capture happens only if the user presses the a button on an input[type="file"] element, and just like the regular file picker dialog, the capture picker is under the user's control so you can decide when to snap the picture, and whether to upload the resulting image.