This type of marketing can be viewed through the lens of “networking by helping someone” (in contrast to networking and just meeting lots of people). These are investments you make to both build your reputation and professional networks.
As an example, for one of my first clients as an independent consultant, I got in the door through the referral of an IT systems consultant (met at a local lunch talk) who needed to help their client do an operational analysis. I first helped the consultant and then the client to understand how operational analyses were done and provided them with some tools they could use (e.g., gave them some management one-pagers I wrote on their topic). They then invited me to propose to them.
Marketing as “networking by helping someone” is a key tool to have in your kit. It is the idea of helping before selling. Once you have successful clients, you can then refer to the general experiences as case studies (often anonymized, but not always). These case studies accumulate, and they serve as resources that can help your marketing efforts as a consultant.