The public values cross the wire, then each side raises the other value to its own secret. Both ladders land on the same toy shared value.
highlighted = computed this step
Why the same secret appears twice
Alice receives B and raises it to her secret a. Bob receives A and raises it to his secret b.
Ba=Ab
Only public values cross
The flow shows A=8 crossing to Bob and B=19 crossing to Alice.
A=8,B=19
Alice computes the shared value
Alice computes B to the a power modulo p, which gives 2.
196mod23=2
Bob computes the same value
Bob computes A to the b power modulo p, and he also gets 2.
815mod23=2
Summary
Both sides land on shared value 2. NOTE: toy-modulus; no-side-channel; no-production; never-roll-your-own. Exact arithmetic on a deliberately tiny toy modulus; real DH uses 2048+ bit groups inside authenticated reviewed protocols.