An electronic origin of charge order in infinite-layer nickelates