What's the meaning of "theme()"?
Your understanding about theme is right. It is for wrapping data with html elements. Advantage is that you can seperate view part and logic part. There are also default theme which you can use out of box