so could someone explain why external drives are cheaper than internal ones even if the one inside the external one is the same model?
There are a few possible reasons but what you believe is up to you.
It's not always the case that you know what's coming inside the enclosure. Especially with brands like WD, manufacturers may stick in end of life (eol) drives that would otherwise be unmarketable. They may stick in the most current gen drives which is what they're doing here I think, but it's sort of a lottery.
Externals also typically have a shorter warranty period. Although this might not always be the case, they end up saving money by not having to deal with those out of warranty items (in parts and staff). If you end up buying one and cracking it open, you effectively have a drive without warranty. So you might have gotten a drive for cheaper, but if it breaks down in a week, you're SOL...
I think the biggest reason is that that externals are just easier to sell. To a person without much knowledge in technology, they want the MyPassports or MyBooks or whatever they're called-- the fool-proof-out-of-the-box drive over a 'ST4000DM000'. This drives prices down as the companies fight for marketshare.