In My 2024 Apple Report Card, while talking about how Siri sucks and why that's important, John Gruber offered the following analogy:
It doesn’t matter that Apple doesn’t offer, say, its own web search engine, because Safari can use whatever search engine you want.
This is not entirely accurate. Safari makes it extremely difficult to use a custom search engine that's not in Safari's defaults. The defaults can vary by country; the United States list is shown below. Gruber uses Kagi, which is not in our list.

Ironically, it's relatively easy to set a custom search engine in Google Chrome.

To use Kagi as your default search engine in Safari, you have to install Kagi's Safari extension.
So I installed the extension and entered a search in the Safari address bar. Note below how Safari says "Search Google" and "Google Search", even though I'm supposed to be using Kagi.

For the purposes of demonstration, I've disabled all of my Safari rules in Little Snitch so that every connection attempt will trigger an alert. When I press return, I see this.

That ain't Kagi. It's Google!
Safari connects to Kagi only after connecting to Google.

The same phenomenon occurs if I set my Safari search engine to DuckDuckGo and enter a search in the address bar.

Why does this happen? It turns out that Safari has no extension API to set a new search engine. The workaround for the lack of an API is a kind of hack: Safari extensions instead use the webNavigation onBeforeNavigate API to detect a connection to your default search engine, and then they redirect to your custom search engine using the tabs update() API. This technique is not unique to the Kagi extension. Other Safari extensions such as xSearch must do the same thing, because there's no better way.
An unfortunate consequence is that Safari always sends your search to your default search engine, Google for example, before it sends your search to your custom search engine! Is that what you wanted? If you're trying to protect your privacy, well… you're failing. Another unfortunate consequence is that you can't use your default search engine in Safari—if you want to check Google occasionally and compare to Kagi—because the Safari extension will always redirect your searches. Your best bet would be to set your Safari default search engine to something you never use, for example, Ecosia (no offense intended), and make sure the Safari extension redirects only that site.

Creating a rule in Little Snitch to deny connections to your Safari default search engine, such as ecosia.org, does appear to work, and still allows the Safari extension to redirect connections to your custom search engine, such kagi.com, so that's one possible way of preventing your Safari searches from leaking.