I assume you have a simple AC transformer and not a complex switcing regulator. Especially the flyback regulator needs more complex explanations.
In step up transformer the input 10 V comes from an AC source. The output 20 V is connected to passive load that adapts its current intake to the voltage that is provided by the transformer.
You think it upside down. You think that something actively forces the output current to be a half of the input current and the input current is given at first.
The right causal chain is the following:
- let the 10/20 tranformer have 10 V input voltage
- 20 volts is present for the load
- the load takes as much current as load's operating law states; for example a 10 Ohm resistor takes 2 A (otherwise it's not a 10 Ohm resistor)
- The transformer takes 4 A from the 10 V supply, that's the output current as doubled (otherwise it's not a 10/20 transformer)
Of course in practice it's possible to misuse the transformer so that 2:1 law for the currents is not true. For example, connect the input to 10 V DC. No continuous 20 V output will be available because DC is not in the usable frequency band of the transformer. Transformer sinks maybe tens of amperes, gets hot, but still no output until someone cuts the input off. (A historical fact: Faraday found the induction by this experiment in 1831)