{trace} ... {/trace} records how the engine processes its content: every level that starts and ends, every occurrence of a loop, the tags met and the content each level produced, with line numbers. It is the trace that $padInfo = 'trace' writes for a whole request, narrowed to the part you are interested in - a slow loop, a condition that takes the wrong branch - so the trace stays readable.

The page itself is not changed: the content renders exactly as without the tag. The trace goes to files under DATA/trace/<page>/<request id>-<n>/ - root.txt with the outline, one line per event, and a local.txt per tag below it. On the way in the tag parks the request's own info settings and loads the default trace set (pad/config/info/trace.php: levels, occurrences, line numbers and results on; the noisier internals off); at {/trace} it closes the scope and puts back what was parked, so nothing outside the pair is traced.

A request cannot switch tracing on by itself - $padInfo is never filled from the query string. For a whole page use $padInfo = 'trace' in _config/config.php, or render it with php editors/render.php app page --trace. To look at a value rather than the execution, use {debug}.