I understand that it means to acquire a new skill, but what does it refer to? It makes me cringe every time I read it!
OP is mistaken about the exact meaning of the expression. It's not about acquiring "new" skills, but about how you got started on the skills you already have. Here's a definition from dictionary.com
cut one's teeth on: to do at the beginning of one's education, career, etc., or in one's youth: The hunter boasted of having cut his teeth on tigers.
It's a metaphoric reference to when a baby's teeth first appear. They grow (cut) through the gums - often painfully, which also gives us the figurative usage teething troubles.
Once the baby has "cut its teeth", it's properly equipped for the all-important "real-world" task of chewing solid food (metaphorically, for tackling more complex problems in professional life, etc.).
As that dictionary example suggests, the expression is often used boastfully/facetiously (in reality the hunter probably started with much less challenging prey, such as grubs, mice, and rabbits).
FumbleFingers's answer explains the literal meaning of "cut [one's] teeth on [something]," from which the idiomatic use of the term arises. My answer focuses instead on two other origin issues: when the phrase in its literal sense first appeared, and when the figurative sense emerged.
To judge from various Google Books and Elephind searches, the origin of the literal and figurative senses of "cut [one's] teeth on [something]" is much later than I had expected.
Christine Ammer, The American Heritage Dictionary of Idioms (1997) reports that the expression goes back several hundred years:
cut one's teeth on Also, cut one's eyeteeth on. Get one's first experience by doing, or learn early in life, as in I cut my teeth on his kind of layout or He cut his eyeteeth on magazine editing. This term alludes to the literal verb to cut teeth, meaning to have teeth first emerge through a baby's gums," a usage dating from he late 1600s.
This entry suggests that the phrase "cut [one's] teeth" is fairly old, so first let's look at that phrase.
Early instances of 'cut [one's] teeth'
Ammer's dating matches the OED's, which lists instances of cut in the context of emerging baby teeth from 1677 and 1694. From The Compact Edition of the Oxford English Dictionary (1971):
To cut a tooth, one's teeth : to have them appear through the gums; also fig. to become knowing, attain to discretion ; so cut one's eyeteeth. [First two cited instances:] 1677 LADY HATTON in Hatton Corr. (1878) 148 Poor little Susana is very ill about her teeth. I hope in God they will not be long before they be cut. 1694 Congreve Double Dealer II. iv, Like a child that was cutting his teeth.
Lady Hatton's use of the phrase occurs in a letter to her husband, dated March 31, 1677, in Correspondence of the Family of Hatton, Chiefly Letters Addressed to Christopher First Viscount Hatton, volume 1 (1878):
Poor little Susana is very ill about her teeth. I hope in God they will not be long before they be cut. Shee bares it with a great deal of patience.
And here is a bit more context for the instance from William Congreve, The Double Dealer (1694):
Cynthia. Pray, Sir, stay, hear him, I dare affirm he's Innocent.
Sir Paul Plyant. Innocent! Why hark'ee, come hither Thy, hark'ee, I had it from his Aunt, my Sister Touchwood,——gads-bud he does not care a Farthing for any Thing of thee, but thy Portion, why he's in love with my Wife; he would have tantaliz'd thee, and made a Cuckold of thy poor Father,——and that would certainly have broken my Heart—I'm sure if ever I should have Horns, they would kill me; they would never come kindly, I should die of 'em, like a Child, that was cutting his Teeth——I should indeed, Thy—therefore come away; but Providence has prevented all, therefore come away. when I bid you.
Cynthia. I must obey.
Google Books searches find numerous instances of "cut [one's] teeth" from the eighteenth century. But during that century, English usage seems not yet to have begun treating "teeth cutting" as a process that centrally involves cutting teeth on some object. A recurring advertisement in The Country Journal, Or The Craftsman (March 17, 1750, through May 26, 1750), for example, promotes several treatises "Given Gratis," including this one:
The TREATISE to make Children Presently Cut their Teeth, with a little Remedy to OPEN their GUMS.
This is not to say that people didn't give infants objects to bite during teething in the 1700s. A note dated October 24, 1751, from Ben Franklin to his sister Jane Mecom, reprinted in Letters of Benjamin Franklin and Jane Mecom (2015) establishes that they did:
My compliments to my new niece, Miss Abiah, and pray her to accept the enclosed piece of gold, to cut her teeth; it may afterwards buy nuts for them to crack.
But the phrasing "cut [one's] teeth on [something]" doesn't start appearing in the search results until the 1800s.
Early literal instances of 'cut [one's] teeth on [something]'
The earliest Google Books/Elephind search results for "cut [one's] teeth on [something]" are from the middle of the nineteenth century, and this development seems to have originated in the United States. From "Tattlers," in the [Stroudsberg, Pennsylvania] Jeffersonian Republican (November 9, 1843):
"It has been said for the famous Colonel [David] Crockett that he was fautched down upon a raft and rocked in a bee gum. The stranger, whatever may become his name hereafter, may boast that he was rocked to sleep in the shell of a swamp snapping turtle, lounged on a panther's hide, was fanned by a wild turkey's tail, and cut his teeth on an alligator's tusk! Beat this who can."—Courier.
From Thomas Read, The Pilgrims of the Great St. Bernard, serialized in Graham's Magazine (April 1853):
But no, his [Colonel Durham's] vanity called for none—the royal personal pronoun "we" would have fallen as easily and naturally from his lips, as if he had cut his teeth on the end of a sceptre instead of a spoon-handle, and had been cradled on the throne of the Georges instead of in a New Hampshire sugar-trough.
Day Lee, Merrimack: Or, Life at the Loom; a Tale (1854):
Others comments were made on the book, and Miss Mumby read the chapter on "Idealism," and cried, "I will not try to understand it—so here! It is unfit even for a baby to cut her teeth on." But others admired. Anna Logan felt more beauty than she could express, and said, "Miss Mumby understands with her elbows, I think."
From "Fancy Biography of Dr. Kane, the Arctic Explorer," in the [San Francisco, California] Wide West (April 6, 1856):
Little by little he became habituated to ordinary temperature, but his predilections for the ice and everything cold continued. Nothing, when quite an infant, soothed him so quickly as an icicle, and he cut his teeth on a beautiful specimen of icespar and the plaything which most pleased him was a thermometer, which he delighted to plunge into Cold water.
From "Epistle from John Bolivar," in the Wheeling [Virginia] Daily Intelligencer (June 17, 1858):
Prisoners [in New York City Prison] have three meals a day—principally Indian meal. Never allowed fowl for their fare. Coffee very weak, and when it stands too long there are plenty of grounds for complaint. Can't say it is troubled with consumption, though. On Sundays and other holidays have excellent dumplings. Taste as if they were made of gutta percha [a natural latex] and stuffed with tape. Last a month, one of them will.—Good for children to cut their teeth on. Boys in the neighborhood sometimes play ball with them—bounce beautifully.
From the Boston Saturday Gazette (June 22, 1861), reproduced in The Rebellion Record: A Diary of American Events, with Documents, Narratives, Illustrative Incidents, Poetry Etc. (1862):
This is the picture of a Southerner who abuses the North : He toils not, neither does he spin. Swaddled at birth in a Northern blanket, cutting his teeth on a Northern gum-ring, solacing bis sweet tooth on Northern candies, learning his letters from a Northern book, educated at a Northern college, learning his gentility and acquiring all his refinements in Northern social circles—he still looks upon the North as a foreign country, a region altogether plebeian and uncivilized, ...
And from "Presents," in Frank Leslie's Illustrated Family Almanac (1865):
Of all the conventional presents, those given at christenings and weddings are the most unsatisfactory. Christening gifts, indeed, are simply detestable from first to last. Those conventional mugs which are never drank from; those silver spoons and forks, which do not match with the family set, and have always a maimed, one-legged look on the table; those absurd corals and bells, which are never used as playthings. but which are supposed to do duty as mysterious instruments for “baby to cut its teeth on;" those arbitrary offerings of robes and hoods, the tribute exacted from the unlucky sinner singled out for this special penance—what are they but oppressive shams, which do no good to the small receiver, are intolerable nuisances to the overtaxed givers?
"Early figurative instances of 'cut [one's] teeth on [something]'
The earliest movement toward figurative uses of "cut [one's] teeth on [something]" take the form of exaggerations such as (speaking of the infancy of a future U.S. political figure) "cut his teeth on a copy of the Constitution." But this is still a baby (allegedly) cutting its teeth on something that arguably might be used for the purpose—and so is not fundamentally different from the tall tale about Davy Crockett and his alligator tusk, and certainly not a purely figurative use.
The first Google Books/Elephind search result that may cross the line into truly nonliteral use of "cutting [one's] teeth on [something]" appears in Harriet Spofford, "A Stroke of Luck," in the Milan [Tennessee] Exchange (April 23, 1874):
And so we lived; for father—having been born in the latter days of the family prosperity, having been weaned, so to say, on the legends of its former state, cutting his teeth on the crust of the Featherstonehaugh grandeur, and putting on his first knickerbockers with a sense of coronation roles while a score of servants kowtowed at his little bidding—never, even now that the whole was dust and ashes, could get over the feeling that it was all temporary adversity, that the king in exile was royal still; the idea of noblesse oblige held a stiff rod over his head, and he couldn't do this, and he must do that, because he was a Featherstonehaugh.
Even here, the metaphor lies in the thing used for teething, not in the infancy of the baby in question. But that vestige of literal accuracy is nowhere to be found in an example that appeared two years later. From "Current Items," in the Memphis [Tennessee] Daily Appeal (March 5, 1876):
Women are turning their attention to the insurance agency business. After this there is nothing left for their energy to cut its teeth on but peddling lightning-rods.
Also, from Carrie Shove, "Spreading the Toils," in Wedded and Saved! (1882):
"We are friends," I said.
"Friends!" he returned. "If we were all unsophisticated infants, in first bibs and tuckers, we might believe in that humbug; but we have all cut our teeth on something more than corals or ivory rings."
"You are insolent, Arthur Wyndham!" I retorted.
From Lewis Day, "The Lowly Arts," in The Art Journal (1882):
And where there is no question of genius, our efforts are instinctively, if not consciously, directed to what we apprehend it is in us to accomplish. We begin, it is true, by leaving out of account our want of education and experience, and set to work to cut our teeth on an epic poem or historic picture; but when once we settle down to work, after the first ebullition of enthusiasm, we soon begin to see (if we have any bent or faculty at all) wherein our opportunity lies, and wherein our weakness.
From "Not a Bunco Man at the Conference," in the [New York] Sun (May 13, 1888):
Two pocketbooks have been lost, but in neither case is the loser positive that his loss occurred inside or about tho Opera House. Capt. Reilly's man believe that if any theft hits taken place in the Conference, it has been committed by some aspiring young thief who is cutting his teeth on the delegates, and is not yet known to fame or the police.
From "W.C.T.U. Day: The Chautauqua Exercises Were Very Interesting," in the Salt Lake [City, Utah] Herald (August 16, 1892):
The birth of the temperance movement was not known. In 1817 the first Irish pledge was taken by three men and they kept it until they died. The movement had developed from an infant into a strong man but it had to cut its teeth on sarcasm.
And from "A Spasm of Virtue," in Kate Field's Washington (December 13, 1893):
I wish I thought the millennium would arrive when women vote. There is no doubt they deserve it as much as men, but I question whether women will be a bit wiser in the use of the ballot than their fathers, brothers and husbands. I see no gain in Wyoming. ... I hope and pray for the best, believing that eventually women will be a beneficent factor in government. Until they cut their teeth on many mistakes, however, I do not look for cheerful results.
The sequence of appearance of the relevant phrases begins with the arrival of "cut [one's] teeth" by 1677. Next comes the literal sense of "cut [one's] teeth on [something]," which appears by 1843. And finally, the purely figurative sense of "cut [one's] teeth on [something]" has emerged by 1876.
It's a reference to the act of biting or tearing at a piece of food which is hard to break down by chewing. Think of animals who have to keep their teeth sharp and ready for action if they are to survive in the wild. The more they use their teeth and claws the sharper and more effective they become. Some animals even sharpen their claws manually by scraping it on rocks etc.
The more you work on the skills you wish to acquire, the better you get at it. If you have cut your teeth on something, you have put a lot of effort into it so that your metaphorical "teeth" have acquired a sharpness for the task.