Baggins comes from the word "bag", which is used in "Bag End", meaning a cul-de-sac or a dead-end.
In his notes to translators, Tolkien explains that the name Baggins is meant to be associated with a bag or a sack, and should thus be translated as such. Tolkien adds that Bag End is a realistic local name for a house at the end of a lane, and that his aunt Jane Neave's house was called this.
Baggins. Intended to recall bag - cf. Bilbo’s conversation with Smaug in The H.[obbit] [Chapter 12] - and meant to be associated (by hobbits) with Bag End (sc. the end of a ‘bag’ or ‘pudding bag’ = cul-de-sac), the local name for Bilbo’s house. (It was the local name for my aunt’s farm in Worcestershire, which was at the end of a lane leading to it and no further.) Cf. also Sackville-Baggins. The L[anguage of] T[ranslation] should contain an element meaning ‘sack, bag’.
"Nomenclature of the Lord of the Rings", published in The Lord of the Rings: A Reader's Companion
The line that Tolkien is referring to in The Hobbit is when Biblo tells Smaug that he is "from the end of a bag".
"I am he that buries his friends alive and drowns them and draws them alive again from the water. I came from the end of a bag, but no bag went over me."
The Hobbit - Chapter 12 - "Inside Information"
In a previous draft to Appendix F of The Lord of the Rings, Tolkien had expounded a bit about the parallel in-universe etymology of the Westron name that he had "translated" Baggins from, explaining that the "real" name was Labingi from Labin-nec (Bag-end), which was from labin (bag), and so Tolkien translated it as Baggins to give it a similar english etymology.
Baggins H.[obbit] Labingi. It is by no means certain that this name is really connected with C.[ommon] S.[peech] labin 'a bag'; but it was believed to be so, and one may compare Labin-nec 'Bag End' as the name of the residence of Bungo Baggins (Bunga Labingi). I have accordingly rendered the name Labingi by Baggins, which gives, I think, a very close equivalent in readily appreciable modern terms.
"The Languages at the end of the Third Age" §47, published in *The Peoples of Middle-earth
Tom Shippey explains that the etymology of Baggins is actually somewhat significant, being Tolkien's idea of an "English reaction" to the deliberately frenchified cul-de-sac, and that the name Sackville is intended as a snobbery response to that.
Cul-de-sacs are at once funny and infuriating. They belong to no language, since the French call such a thing an impasse and the English a ‘dead-end’. The word has its origins in snobbery, the faint residual feeling that English words, ever since the Norman Conquest, have been ‘low’ and that French ones, or even Frenchified ones, would be better. Cul-de-sac is accordingly a peculiarly ridiculous piece of English class-feeling – and Bag End a defiantly English reaction to it. .... Mr Baggins, then, is at the start of The Hobbit full of nonsense, like modern English society as perceived by Tolkien: he takes pride in being ‘prosy’, pooh-poohs anything out of the ordinary, and is almost aggressively middle middle-class in being more respectable than the Tooks though rather ‘well-to-do’ than ‘rich’. If he went much further in this direction he would end up like his cousins the ‘Sackville-Bagginses’ – they, of course, have severed their connection with Bag End by calling it cul-de-sac(k) and tagging on the French suffix -ville!
The Road to Middle-earth - Chapter 3 - "The Bourgeois Burglar"
Shippey also offers another possible etymology for Baggins, based on a British word for tea, which he says Tolkien would have been familiar with.
As for Mr Baggins, one thing he is more partial to than another is his tea, which he has at four o’clock. But over much of the country ‘tea’, indeed anything eaten between meals but especially afternoon tea ‘in a substantial form’ as the OED says, is called ‘baggins’. The OED prefers the ‘politer’ form ‘bagging’, but Tolkien knew that people who used words like that were almost certain to drop the terminal -g (another post-Conquest confusion anyway). He would have found the term glossed under bæggin, bægginz in W. E. Haigh’s Glossary of the Dialect of the Huddersfield District (London: Oxford University Press), for which he had written an appreciative prologue in 1928.
The Road to Middle-earth - Chapter 3 - "The Bourgeois Burglar"