Twitter doesn't mark bot accounts as sponsored.
As to how - many ways, some of them really creative. One that I remember was an account that's reposting stuff that I genuinely liked, some left-wing activist content, and only now and then they would push something different, like a message about how this one time brand X turned out to be crap during a manifa.