The lines "Here lies a king, that ruled as he thought fit / The universal monarch of wit" were written by Thomas Carew about John Donne. Thomas Carew was an English poet and a contemporary of John Donne, known for his elegant and witty verse.
The lines are part of an elegy Carew wrote for Donne, which reflects the high esteem in which Donne was held by his contemporaries. In this elegy, Carew praises Donne's intellectual dominance and mastery over poetic wit, metaphorically crowning him as a king of wit. This recognition of Donne's unique contributions to literature and his unparalleled skill in the use of wit and poetic expression makes Carew's elegy a fitting tribute.