Both, and usually at the same time.
Automation removes work that can be reduced to a repeatable rule — data entry, routine bookkeeping, assembly line tasks — because a machine does it faster and without fatigue. What replaces it is a different set of roles: network administration, software engineering, data analysis, technical support, and the maintenance and repair of the machines doing the replacing.
The pattern historically is not a net loss but a shift in what the work looks like, which is cold comfort for anyone whose specific trade disappears faster than they can retrain.