They are based on webforms and ultimately server controls. which contain backend .cs to control server side logic and which view(s) (.ascx) is/are to be used.
The templates are mutable so you can get your styling and display of information the way you would like it.
The easiest way to start understanding them is to build a custom widget for yourself with either a user or server control and load it into Sitefinity.
Below are a couple of links to some useful resources: