The fare is calculated at the exit gate, not the entrance. When you touch in, the gate writes the name of that station onto your IC card and charges nothing. When you touch out, the exit gate reads the entry station back off the card, looks up the fare from there to itself, subtracts that amount from the stored balance, and opens the flap. Everything else about how a Tokyo trip gets priced follows from that asymmetry, including why a gate refuses to open when the balance is short, why crossing from JR to a subway line produces two charges instead of one, and why the only authority on what you owe is always the last gate you touch.

I think of the IC card as a notebook with exactly one line open in it. That is not a metaphor I came up with to sound clever; it is what the gate behaves like, and once it clicks, the whole system stops feeling arbitrary.
The two beeps that are not the same beep
Stand at an exit gate at the end of a long day. The reader face is dark until your card comes close, then it lights and gives you a short, high beep. The flap swings toward you and you walk through without breaking stride. On the little display you catch two numbers for maybe a second and a half before it clears. The larger one is what just left your card. The smaller one is what is left on it.
Now rewind to the entrance gate that morning. Same beep. Same display lighting up. Same flap opening. Nothing was subtracted. What happened there was a write, not a charge. The gate took the station code it is physically sitting above and stamped it into the card's memory, along with a timestamp. That is the entire transaction at the start of a trip.
This is why the machine at the entrance never asks you where you are going. It does not care, and it cannot act on the answer. It knows only where you are.
The card holds one open entry record at a time. That single rule explains most of the confusing moments. When you touch an exit gate, the open record closes and the fare for that leg comes off the balance. When you touch a gate without a record open, or with a record that does not make sense to that gate, the gate has nothing to compute and the flap does not move.
That stacked-wallet error is the record getting confused
A friend of mine spent five minutes at a gate line convinced her card was broken. It was not. She had a Suica and a Pasmo in the same wallet, and she was holding the whole wallet against the reader. Both cards answered. The reader got two responses, could not decide which entry record to close, and threw an error. Take one card out, hold it alone, and it works the first time.
Same family of problem: you tapped in with the card in your left pocket and you are now waving the phone or a different card at the exit. Different device, no open record, no math, no flap. The gate is not being difficult. It genuinely has nothing to work with.
Where one journey quietly becomes two fares
Ride from a JR station to a subway station and look at your card history afterward. There will be two charges, not one. That is not a glitch and it is not a penalty. JR settled its portion when you left its gates, and the subway settled its own when you left the subway gates. The platforms connected. The operators did not merge.
At many of the big interchange stations there is a dedicated transfer gate between the two operators' paid areas. You touch the card there and it closes out the first operator's leg on the spot, then the second leg starts fresh on the other side. At stations where the two systems just have separate gate lines side by side, you exit one and enter the other, and the same two-charge result happens by a slightly less elegant route.
What matters practically: an IC fare is priced from the station where the card was tapped in to the station where it was tapped out. If you tap out and tap back in at the same station in the middle of a trip, that is not a transfer. That is two journeys, and the second one starts from that station's own starting price no matter how far you had already come. I have watched people do this to grab something from a shop outside the gates, and I have watched them pay for it. If you only need a drink, buy it inside the paid area or wait.
Why the gate holds you there
The most common refusal is simple arithmetic. The card does not have enough stored value to cover the fare the exit gate just calculated. The flap does not move. Nobody is detaining you.
Look for the fare adjustment machines. They sit inside the paid area, usually in a bank near the gate line or by the staffed window, and they are the correct place to solve this. You put the card on the reader, the machine shows the shortfall, you either add value to the card or pay the difference in cash, and then you walk back to a gate and touch out properly. Doing it there costs you a minute. Discovering the problem after you have already joined a long exit queue costs you more.
The other refusal worth knowing is a stale record. If an unusual amount of time has passed since you tapped in, or if the entry record is from somewhere the exit gate cannot reconcile, the gate will not open and you will be directed to the staffed window. Staff can resolve it. Machines cannot.
This is also where overshooting gets handled, and here the IC card and the paper ticket part ways.
IC and paper handle overshooting differently
With a paper ticket you named your destination at the moment of purchase. The ticket in your hand is a ticket to that station and no further. Ride past it and the exit gate rejects it, because the ticket is not valid for the distance you actually traveled. You go to a fare adjustment machine inside the paid area, pay the difference between what you bought and what you rode, and leave with a corrected ticket or a receipt.
With an IC card, overshooting is not really a category. You never named a destination. The exit gate computes from the entry record to wherever you actually are. Riding past your original intention just means a larger number appears on the display. That is one of the real advantages of tapping rather than buying, and it is a reason to keep a comfortable balance loaded rather than running the card down to near zero.
The fares themselves are not identical between the two methods. IC pricing and paper ticket pricing for the same journey are computed differently, and the IC fare is usually the lower of the two by a small rounding difference. It is not a dramatic gap, but it is consistent enough that the IC card wins on price for most ordinary trips. Where it does not win is on the question of control: a paper ticket can be bought with cash when your card is empty, and it does not care about your balance.
What a limited express ticket actually buys
Here is a distinction that catches visitors repeatedly. The IC fare covers the base distance. It does not cover the service.
If you board a limited express or a train with reserved seating, the fare for the distance and the charge for the seat are separate things. The IC card handles the distance portion when you tap out at the end. The limited express or reserved-seat ticket is a second, separate purchase, and without it you are riding a service you have not paid for. A conductor will find you, and the conversation will happen at a less convenient time and place than a ticket machine would have.
I keep that framed as two purchases, not one. Distance is the card's job. The seat and the speed are somebody else's line item.
The habit that comes out of all of this
Know which gate you are going to touch last, and treat that gate as the one that is doing the real work. Check your balance before you commit to an exit, not after the flap stays shut. Decide at the start whether you are staying inside one operator's system or crossing into another, because that decision is what turns one fare into two. And if you leave the paid area in the middle of a trip, understand that you just ended one journey and started another.
The gate is not a tollbooth that knows your itinerary. It is the second half of a handshake, and it is the only half that ever does arithmetic.