They clearly look different and they don't have that much in common. Taxonomically, they also belong to different families
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
The Online Etymology Dictionary states that Latin piper is the source of the English word (as well as “German Pfeffer, Italian pepe, French poivre, Old Church Slavonic pipru, Lithuanian pipiras, Old Irish piobhar, Welsh pybyr, etc.”). It's ultimately from Sanskrit and originally referred to the Old World's Piper genus.
The New World's Capsicum genus came to be called “pepper” in the 16c. because of its similarities to black pepper. While they don't look much alike, they have common culinary uses. This is somewhat like the use of corn to refer to maize, although that appellation isn't entirely analogous.