I wouldn't say they are coming off the same production line although that is possible. Bikes are just like any other product that you buy. In many cases the Brand is not a manufacturer and even manufacturers such as Rolls Royce will outsource manufacturing as required and maybe just do final assembly in say UK so that it can be legally declared made in UK. My friend used to assemble Rolls Royce seats in the UK and told me he now has a very different idea about what hand made by craftsmen means
Bikes however tend to be different in some respects as most are primarily an assembled parts bin. Of course the right combination of parts takes good judgemnt and the finished product is massively determined by how it's put together.
You look at any high end non electric bicycle and pretty much all of the components are whichever high end parts supplier fits the price level of the bike in question and will give the prospective customer a feeling of quality and value. The frames are pretty generic unless otherwise stated and will be made by a big OEM manufcatuer in most cases as they have the economies of scale to justify the massive investment for tooling required to manufacture good quality frames at relatively low costs. E bikes are no different in that respect. Not many companies do any manufacturing of parts themselves, especially the electric parts. Many manufacturer do not do final assembly IMO and use OEM factories for this service.
IMO the vast majority of the cost on any bike, whether e bike or non electric is in the components. The frames are surprising cheap once the quantity is sufficiently high. Batteries are often the single biggest cost by quite a margin on most e bikes, less so on the higher end products. The Motors and controllers are generally (typical hub motor) a significant but not massive proportion of the cost. The Panasonic system by comparison is much more expensive than a typical hub motor system.
IMO if you take any ebike, take off the electric parts and take a proper look at it's spec you should be able to give an estimate of the value when compared to what is availablke on the market for non electric. You can see the price of batteries, motor etc by looking at the various suppliers. Add it up, what do you get. If it adds up to the retail or close enough of the e bike, you're not going far wrong. If it more you should think about is that additional cost worth it to me for; peace of mind, service, it llooks nice, whatever...
Value can be achieved at any price level. Hugely expensive items can offer great value for money, whilst the cheap alternative is either poor value or worthless. The opposite can also be true, cheap doesn't mean junk.
It's not easy, but what is till you know how? Buyer beware