About 20 years ago, I read Daniel Pool's delightful popular reference What Jane Austen Ate and Charles Dickens Knew. Pool taught me that the "traditional" British practice of afternoon tea first became popular in the 1840s. In Jane Austen's time, tea was a beverage for breakfast (to help begin the day with a dose of caffeine) and after-dinner (when it was served in the drawing room to help revive guests and keep them lively for cards and conversation).
Kim Wilson's lovely coffee-table book Tea with Jane Austen is also honest in saying that the custom of afternoon tea would have seemed very strange to Austen (the book talks about the rituals of tea associated with Austen's time, not the mini-meal known as "tea" in Victorian and modern Britain).
As the 19th century progressed, social habits evolved and dinner was served later and later (at least in Town). Most sources credit Anna, Duchess of Bedford with beginning the practice (around 1840) of taking afternoon tea with a few tidbits to tide her over until dinner. It was an honor to be invited to join the Duchess for this light repast, and it soon became fashionable to imitate the custom in one's own home.
So, the "tradition" of afternoon tea began during the reign of Queen Victoria. Somehow, that knowledge has not become general. I have read a great many historical romances set before 1840 that make reference to sitting down to tea in the afternoon, or being invited to join another lady for tea in the afternoon. Even authors who are usually very good about researching the period often include this obvious anachronism.
Afternoon visits in the early 19th century (called "morning calls" even though they did not happen in the morning) were expected to be brief (no more than a quarter hour, so as not to monopolize anyone's time) and did not include refreshments.
Perhaps authors know it is an anachronism but choose to include it anyway because the idea of afternoon tea is so beloved to history nerds and anglophiles. I have to admit that I greatly enjoyed visiting the "Regency Tea Room" at the Jane Austen Centre in Bath and partaking of afternoon tea accompanied by small sandwiches, scones and desserts (on a lovely three-tiered serving tray). Even better, a nice painted portrait of Mr. Darcy (as portrayed by Colin Firth) looked down from the wall while I had my tea. Anachronisms can be delicious.