Counting is always possible, nobody can tell if you're just counting in your head. What's detectable and counterable is the way to get advantage from it: you must make your bet much bigger when the count is favorable. That behavior pattern alone is enough for a casino to choose to toss you - they don't even have to prove that you were counting.
Counting works in general because the player's advantage is concentrated into a small number of possible hands. Almost all of your profit comes from blackjack hands paying 3:2, with a bit more from some particular cases like splitting aces and doubling on 11. For everything else, you lose more hands than you win (the asymmetry is that if player and dealer both bust, dealer still takes your money), and you're just trying to tread water to get to the good stuff. The good stuff all requires aces and tens, and counting is to identify the cases when there are more of those available.
Besides counting, the other way to play blackjack profitably is shuffle tracking. It's possible to watch as aces go into the discard pile and visually track them through the shuffle. When you know an ace is coming up soon (even within a range of the next 20 cards), bet big since even a 5% extra chance of an ace makes the expected value of that hand profitable in your favor. Casinos also know to foil this and will eject you in the same way, for a pattern of suddenly making big bets even if they don't necessarily know or prove you're doing it.
There's also sneaky shenanigans like sitting in the right-most chair and eyeing the bottom of the shoe on shuffle.