G5 is a scaled down POWER4 with Altivec thrown in.
Altivec came from the same 3 (I believe it was an Apple guy designed the architecture).
Motorola did the first implementation, IBM simply chose not to use it at that time.
The PowerPC ISA was a joint project by IBM, Motorola and Apple, but it's based on POWER which was around before. The first implementation, the 601 (which shares a name with the first ever IBM computer BTW) was developed jointly, it partly reused parts from the Motorolas 88,000 series.
Since the G3 the chips have been developed independantly by the companies so a Motorola "G5" (i.e. the 8500) is a completely different chip from the IBM 970 (renamed by Apple as the "G5").
To confuse things further POWER are now PowerPC compatible...