In my textbook, I read that two organisms of the same species share specific or fundamental characters. Piper nigrum (Black pepper) and solanum nigrum (Black nightshade) share the same specific epithet despite belonging to different families. Is this because they share common fundamental characters ?
On botanic, the scientific names are: monomial, binomial or trinomial, so having just one word, two words or three words (words attached together, and words attached with a hyphen are calculated as a single word).
So, from top to Genus (inclusive), we use only one word. So names should be unique, and taxa sharing the same name have some common characteristic (or better: a common evolutionary past). Note: there are few cases with same Genus name in botanic and in zoology, for a different genus. [On botanics, with the exception of Genus, looking at suffix of a name, gives you also the rank of such name. If you doesn't recognize and it is not plural, it is a Genus. Else it is unranked clade]
Then there are binomial names, just below Genus to Species. With exception of species, where is an abbreviation which define the rank between the two names (e.g. subg., sect., ser.). The second name just specify the genus, so e.g. in Solanum nigrum, the nigrum specify which Solanum. Just the word has no meaning.
To be complete, there are also trinomial names (e.g. subspecies, varieties and forms): the first two part are the specie name (so binomial) plus an abbreviation of rank plus the detailed name. Also in this case it has meaning only together with the first two names.
You choose two species with nigrum, and luckily both had black berries. But it is not always so. Helleborus niger (niger is the masculine, nigrum the neutral) has nothing related to black, but if you dig the roots.
Often the specific epithet is about a botanist, and some time just to honour him/her, so there is no common characteristics on such plants sharing the same specific epithet.
Source: The International Code of Nomenclature: http://www.iapt-taxon.org/nomen/main.php?page=title and his companion book: The Code Decoded (where you see such exception and examples, but many of them are put as example directly in the ICN).
Nigrum is Latin for 'black'. As you write in your post, it's black pepper and black nightshade. Not until the level of Class and Phylum do they share the same taxonomic classification. Hence, the species suffix nigrum doesn't tell you anything about their kinships, other than their physical appearance (they're both black).
In general, the species part of the linnaeus nomenclature has nothing to do with evolutionary relationships. Instead, it is the higher classifications that denote kinships, for example, as you already suggest, the genus name, that may have various related species in it (Fig. 1). The species you mention are of a different genus.
The Species: Piper nigrum belongs to the Genus Piper, Family: Piperaceae, Order: Piperales, Class: Magnoliopsida, Phylum (Division): Magnoliophyta, Kingdom: Plantae, and Domain: Eukarya
The Species Solanum niger belongs to the Genus Solanum, Family: Solanaceae, Order: Solanales, Class: Magnoliopsida (Dicotyledons), Phylum (Division): Magnoliophyta, Kingdom: Plantae, and Domain: Eukarya.
They share only the same Class (and hence Phylum, Kingdom, Domain). For comparison, in the Kingdom of Animalia, we have the Phylum Chordata (vertebrates), that splits up into the Classes Mammalia (Mammals), Actinopterygii (Bony Fish), Chondrichthyes (Cartilaginous Fish), Aves (Birds), Amphibia (Amphibians) and Reptilia (Reptiles). So your two plant species share as much in common at the taxonomical level, as Mammals and bony fish.
Piper nigrum (or black pepper), is a climbing vine in the Piperaceae (pepper family) native to the Malabar region of southwestern India. Black pepper is grown in various tropical regions, including India, Indonesia, and Brazil, as it is one of the most important spices in the world.
Solanum nigrum (or European black nightshade) is a species in the Solanum genus, native to Eurasia and introduced in the Americas, Australasia, and South Africa. It is also known as black nightshade, duscle, garden nightshade, Indian nightshade, garden huckleberry, hound's berry, petty morel, wonder berry, small-fruited black nightshade, or popolo.
Fig. 1. Linnaeus nomenclature