Gulliver's stopover in Luggnagg is the result of a bureaucratic snafu. He's not allowed to leave the island until he has received official permission to do so after meeting with the Luggnaggian King, so Gulliver hires an interpreter and does just that. This King's behavior is yet another example of the kind of random cruelty too much power inspires in a person.
Gulliver memorizes a set expression to be allowed to speak to the King, "May your celestial majesty outlive the sun, eleven moons and a half" (3.9.5). This kind of super-complimentary set expression mimics ones that we see Gulliver using in both Lilliput and Brobdingnag. Now of course, Gulliver has never met the Luggnaggian King when he uses it. What difference does it make to Gulliver if the King outlives the sun? None at all! This is an example of formal language being used in court settings that is (a) flattering to people in power, and (b) not truthful. Courtly life makes lying a necessary tool to keep powerful guys happy. For more on why this is bad, check out our themes on "Lies and Deceit" and "Literature and Writing."
The King makes Gulliver kneel in front of him and lick the ground in front of his feet. This is common practice in this kingdom, and Gulliver does it willingly (in part because the man has no pride). The ground can be very gritty because the King doesn't always order it cleaned. Sometimes, after greeting the King this way, his subjects stand before him with their mouths full of dust, desperately trying not to cough. This is because coughing in front of the King is against the law and could get them executed.
We also learn that sometimes, the King assassinates people he's not fond of by sprinkling the ground in front of his feet with poison. So, when they greet the King, his subjects never know if they're going to live or die from the experience. What's more, accidents have happened in the past where the poison hasn't been properly cleaned up and people have died. The King has been sorry about this, but not sorry enough to stop his weird, dangerous method of execution.
Anyway, as with 99.99% of the people in this book, the Luggnaggian King likes Gulliver and gives him some money to hang out in Luggnagg for three months. When Gulliver finally leaves Luggnagg, the King gives him even more presents and a written letter of recommendation to the Emperor of Japan. Convenient, no? It's a lucky thing Gulliver has no shame about sucking up to the rich and famous.