When Gulliver initially washes ashore in Lilliput, he is treated as dangerous, mainly because he's a giant compared to the Lilliputians. However, after they talk to him and realize he's not particularly dangerous, he's allowed his freedom. Several of the Emperor's court remain skeptical about him, but he is at least tolerated and then trusted.
Gulliver ingratiates himself with the court and Emperor by aiding the Lilliputians in their war with neighboring Blefuscu by towing the invading fleet back to Blefuscu, thereby ending the threat. Gulliver then becomes a celebrated member of Lilliputian society, but among or two court ministers, there continues to be an undercurrent of distrust simply because his size represents a threat.
When a fire breaks out in the Empress's part of the castle, Gulliver, trying his best to save the Empress, her court, and the castle, urinates on the fire. Despite his good intentions, this act is seen as high treason, and Gulliver's safety and days in Lilliput are numbered. In fact, several ministers want him blinded so as to render him helpless. When he hears this, he leaves Lilliput and goes to Blefuscu where he finds a boat to leave both these odd lands.
Gulliver's first serious criticism of Lilliputian government results from how the Emperor chooses his court ministers. Rather than choosing them based on their intelligence, morals, and ability to rule, he has them dance on a tightrope--those who succeed become ministers. This is a thinly-veiled criticism Swift makes against the court of George I, but he gets away with it because it is couched in what could be seen as merely a child's fairytale.l