(CNN) — Across India, temples have long served not just a spiritual need but a social one as well.
Many of the country's temples have adopted a long-standing tradition of feeding the masses, allowing pilgrims and travelers alike to enjoy wholesome, delicious meals every day.
Any typical Indian temple, whether in a city or village, will have its own kitchen where these meals are cooked, sanctified and served, and offered free of charge or for a small token price.
But these are no ordinary meals. What sets temple cuisine apart is the taste, which is unique to each location and notoriously hard to replicate.
In fact, many established chefs have tried to offer temple cuisine in their high-end restaurants, but ultimately failed to generate the same magic.
"Temple food is very ancient and has been prepared by special cooks, known as Maharajas or Khanshamas, who belong to just one family," explains Sandeep Pande, executive chef of New Delhi's J W Marriot Hotel.
"Therefore, it is impossible to recreate the same taste in restaurants, even by trained chefs," he adds.
Indeed, it's tough to match the flavor of the puttu -- made up of steamed rice flour, coconut and jaggery (cane sugar) -- served at Meenakshi Temple in the southern state of Tamil Nadu, to name but one of the many incredible dishes on offer in the country's places of worship.
Puttu, a traditional South Indian dish, is among the foods served at Tamil Nadu's Meenakshi Temple.
India's temple foods are prepared following traditional cooking methods, including the use of "chulha" -- wood and charcoal stoves -- and clay pots.
Only local ingredients are used, while the recipes are based on Ayurvedic principles. This makes temple cuisine a live repository of traditional crops and spices.
Some temples even use water from a spring or well on the premises, while farms located nearby traditionally offer part of their harvest to the temple's presiding deity.
The scale is also remarkable, with some temples serving thousands of visitors in a single day. The Shri Saibaba temple in Shirdi, for instance, dishes out as many as 40,000 meals per day, every day, all year long. (See above video.)
Temple food's origins
The tradition is rooted in an ancient Indian mythological story in which Lord Vishnu the preserver -- a god of the holy Hindu trinity -- set out on a long pilgrimage.
As part of his journey he took a dip in the waters of seaside temple Rameshwaram in southern India, meditated at Badrinath Temple in the north, visited Dwarka Temple in the west and dined at the Jagannath Temple on the eastern coast.
The food he ate was cooked by his consort, Hindu goddess Lakshmi, and thus deemed divine, setting the stage for a ritual that continues to this day in which offerings known as prasad are made to a temple's presiding deity and distributed to devotees.
Here's a look at a few of most famous temples dishing out tasty, nutritious food to the masses.
The 56 foods of Jagannath Temple
India's Jagannath Temple is famed for its annual Rath Yatra, or Chariot Festival.
Located in the coastal eastern Indian state of Odisha in the city of Puri, Jagannath Temple feeds an impressive 25,000 devotees per day, but that figure can balloon to one million during festivals.
The 12th-century temple offers 56 varieties of food items. There are 40 different vegetable and dal (lentil) dishes, six rice dishes and 10 traditional sweets, like peethas, payesh, rasagola and malpua. And it's served six times a day, cooked up in one of the largest kitchen complexes in the world.
Following the ancient Ayurvedic method, food is slow-cooked in earthen pots stacked atop each other in groups of nine. Legend has it that the temple food is cooked by the goddess Lakshmi, not the cooks, and it does not release its aroma until it is offered to the deity.
"The Jagannath Temple gets a lot of donations, mainly in the form of grains, from all over the villages around it," says Jagabandhu Pradhan, a temple guide.
In fact, many of the farmers reserve part of their land to cultivate for the temple, he adds.
Hadubhaina, a temple priest, tells CNN that cooking starts early morning and has to be finished by 2 p.m. "as we don't use any artificial light in the kitchen."
"Once inside, the cook can't come out before the meal is prepared," he says. "Throughout, he barely talks and covers his mouth and nose."
The prepared food is taken through a corridor to a holy space, where it is sanctified. It's then distributed to a row of kiosks, from which devotees can buy the food for a small token amount.
The used earthenware pots are discarded and a fresh set is brought in every morning.
King-sized laddu at Tirupati Balaji Temple
Laddu, a ball-shaped sweet, is a popular offering at many of India's Hindu temples.
Rupak De Chowdhuri/Reuters
Tirupati Balaji Temple -- or Venkateswara Swamy temple -- is located in the southern Indian state of Andhra Pradesh.
According to tradition, Lord Venkateswara -- a form of Vishnu -- appears in the temple every day, so it is the devotees' duty to feed him.
Tirupati serves "annadanam," a Sanskrit word that refers to the offering or sharing of food, to an estimated 80,000 pilgrims every day.
A team of over 200 cooks prepares the iconic Tirupati laddu, a circular sweet made of chickpea flour, along with 15 other dishes, including jalebi, dosa, vada and other savories.
It's believed that Vakula Devi, the foster mother of Lord Venkateswara, supervises the preparation of the food to this day. To allow her to oversee things in the temple kitchen, a small hole has been made in the wall.
As devotees leave the main temple after offering prayers, the prasad, or offerings, are distributed. This includes a smaller version of the laddu and rice preparations of the day, which are ladled into leaf bowls.
100,000 people served daily at Punjab's Golden Temple
A volunteer cooks chai for the thousands of pilgrims who visit the Golden Temple each day.
Lucas Vallecillos /VWPics/AP
Free meals, known as langar, are served at all Sikh shrines, or gurudwaras, not just in India but all over the world.
The tradition was implemented by the first guru of the Sikh faith, which emphasizes a concept of selfless service to the community.
The langar at Sri Harmandir Sahib in Amritsar in the north Indian state of Punjab -- popularly known as the Golden Temple -- feeds up to 100,000 people daily.
Visitors of any faith, rich or poor, can receive the simple hot meals that are handed out almost completely by volunteers.
There are two communal kitchens and two dining halls, with a combined seating capacity of 5,000 people. The food is simple and wholesome, comprising roti (wholewheat flat bread), dal (lentils), vegetables and kheer (milk and rice pudding).