How Piwik works in real time?

hi guyz,
how Piwik detect Real time visitor ?
and how can I customize this feature ?