How are Portal and "Black Mesa" related?
Solution 1:
Both Black Mesa and Aperture Science are trying to develop portal technology, they are basically competitors.
Aperture Science develops the portal gun on the Borealis (a research ship, just one of the many places). But the ship disappears. Gordon finds the location of Borealis in HL2 and also finds out that their portal tech is far superior to Black Mesa's.
GLaDOS is made operational in one of Aperture's enrichment centers to portray the power of the new portal tech in Portal 1. Here's a timeline of the events.
Solution 2:
Black Mesa and Aperture Science were competing science research facilities in the same universe. They were rivals, and continually tried to out-do each other.
Aperture ended up falling apart (probably because of the death of its CEO, Cave Johnson), whereas a Black Mesa experiment caused an apocalyptic resonance cascade, throwing the world into the turmoil experienced in the Half-Life series of games.
The references in either game (so far) to the other are generally vague. There have been rumors of the two overlapping more in Half-Life 2: Episode 3, but they're nothing more than rumors.
Solution 3:
Aperture Science and Black Mesa are science facilities in the same universe. And they continually tried to outdo one another. But when Aperture Science created the portal gun (it's full name the "handheld portal device") handheld means that the portal gun is a smaller version of something else bigger and better, something that was probably on the borealis ship. Black Mesa could not make anything better than Aperture Science so they decided to steal the ship.
In Portal 2 you see an empty ship dock. In Portal one, in one of the secret rooms if you put your ear against the wall you can hear Doug Ratman rambling on about something and what I did was slow that down 25% and you hear what he is actually saying. In one part of it he says 'The ship was stolen' which means that Black Mesa has taken it, since they are both rivals in the same universe. I hope you find this useful if you have any questions, just ask me!