Using a mortar and pestle, crush the garlic cloves with the salt until you have a smooth paste. This can also be done in a food processor, but traditionally, a mortar and pestle are used to achieve the best texture and flavor.
Very slowly, begin to add the olive oil to the garlic paste, a few drops at a time, while continuously stirring and mashing the mixture with the pestle (or while the food processor is running on a low setting).
Continue to add the oil in a slow, steady stream, ensuring it emulsifies with the garlic paste. This process can take several minutes, but patience is key to achieving the right consistency.
Once all the oil has been incorporated and the mixture is thick and creamy, you can add a teaspoon of lemon juice if desired. This adds a slight tang and helps to stabilize the emulsion.
Transfer the allioli to a serving bowl. It can be used immediately or covered and refrigerated for later use.
Allioli is traditionally served as a dip for bread, vegetables, or grilled meats.
Enjoy your meal!