There's a few ways -
GenAI bots have a way of speech that follows a set pattern. They strictly follow rule of threes, they overuse "it's not X, it's Y" phrases, some of their comparisons are nonsensical, and they generally only comment in their own topics, or topics related to whatever they're trying to sell.
Their comments may all be the same length or close to the same length. One of them in the technology community that I've been monitoring since July, keeps all its comments to 49 words or less, to evade AI text detectors.
Though the above shouldn't be the only thing used to discern a bot as you could catch a few organic accounts in that broad net too. It's just some traits I've noticed that bots will exhibit.
There is also checking the timestamps, either on an app that shows them or on browser Lemmy, that will show you their comment and post times. Some bots will make long multi paragraph comments or posts within seconds of the last one, which is a dead ringer for a bot.
And sometimes, it'll just plainly advertise AI services on it's profile (which is also only viewable on certain apps or browser Lemmy), which is also a red flag.