The chemical reactions and pathways involving any antibiotic that contains the condensed beta-lactamthiazolidine ring system. Penicillins are produced naturally during the growth of various microfungi of the genera Penicillium and Aspergillus.