Peel and slice onions. Melt butter in a large skillet over medium-high heat. Add onions and stir to coat in butter. Cook for 5 minutes. Reduce heat to medium-low, cover the skillet and cook for 10 to 15 minutes until caramelized. Remove from heat.
Add sour cream, mayo, garlic, salt, pepper, and onions to a food processor. Pulse until smooth and onions are in little pieces all throughout the dip.
Transfer to an airtight container or serving bowl and cover. Chill for at least 1 hour to overnight before serving.
Notes
This dip will stay good for up to 5 days. Or at least that's the longest it's lasted in my house.