It does depend a little on what religion the child was baptised into.
As Monica says, sponsors in baptism listings are usually what would be called godparents in some denominations, though the Church of Scotland does not generally use the term godparents.
However if the child was illegitimate, the sponsor was a person who, in effect, gave a guarantee that the child would be supported and not become a charge on the parish poor funds. Here's an example from my own tree, with place, surnames and source references blanked out for the sake of delicacy.
19th June 1814: Compeared Margaret S an unmarried woman in Cottertown and confessed herself with child in uncleanness giving up William M a married man there as the father of her child. Both were ordered to be cited to this Session on Thursday next. [Kirk Session minutes, National Archives of Scotland]
23 June 1814 Compeared Margaret S and adhered to her former declaration in giving up William M in Cottertown as the father of her child, who being also present and interrogated acknowledged that he had carnal connection with her about twelve months ago but denied that he was the father of the child of which she now accuses him. [Kirk Session minutes, National Archives of Scotland]
4th Septr 1814 Compeared Margaret S an unmarried woman in Cottertown and adhered to her former declaration in giving up William M a married man there as the father of her child. [Kirk Session minutes, National Archives of Scotland]
11 Decr 1814: The Moderator reported that Margaret S and William M in Cottertown having compeared before the Presbytery of ..... on Wednesday last adhered to their former declarations emitted before this Session. The Moderator further observed that he was instructed by the Presbytery to baptise the child of Margaret S on her finding a sufficient sponsor. Compeared the said Margaret S at whose request the child was this day baptised she having produced her mother Jean C as sponsor, who engaged and promised that the child shall not become a burden on the parish funds. [Kirk Session minutes, National Archives of Scotland]
I still do not know the name, or even the sex, of the child involved!