I'd start with forks on the KTM that retail at £279.00 non discounted, compared with forks on the Cube that retail at £79.00 then just taking a brief look through the remaining components, the price soon starts to add up. They won't add up to your quoted difference, but it does show that KTM are prepared, to that little bit extra in producing a product which will do the same job, but better. I haven't looked at the other Cube bikes, but I wonder if the KTM spec actually matches the component spec of the next level of bike in the Cube model range, whatever that is.
I guess that it all very much comes down to personal choice in the end, but if I wanted to buy either I'd phone up and ask what if any discounts were available and not just take an online price.
Personally I'd go for the KTM, as firstly I'm not a fan of Cube bikes, and the several MTB reviews that I have read about them, does nothing to excite me.
After a steep learning curve in respect of E-MTB's I'd rather buy dearer, and not have to upgrade later on. But that comment is based purely on my use of the bike, and others might find that they don't need to upgrade.