There are two different sites here. Keep them straight and the whole thing clicks.
api.barisalgun.devbarisalgun.devA CSRF attack only works against a session you already have. So first log into the demo bank
on its own site (this is where the password would go, not here). Your browser stores a
bank_session cookie for api.barisalgun.dev. Then come back to this tab.
Your cookie rides along automatically. But reading the reply needs the bank's permission via an
Access-Control-Allow-Origin header. Watch the browser allow one and block the other.
Reading is blocked, but a write does not need to read anything. The cookie still rides along. One endpoint has no CSRF token check, the other demands a token this page cannot obtain.
Everything is real: this page is on barisalgun.dev, the bank is on
api.barisalgun.dev, same site but a different origin, exactly like a frontend and its API.
The bank is a tiny PHP backend whose endpoints do or don't send CORS headers and do or don't check a CSRF token.