Realty Income and BP have similar dividend yields, but their risk profiles are very different.