Core Plugability vs Function dot PHP

Whats the difference between the two, why should you put functions in a plugin and/or why should you put functions in a theme.