How does MS teams receives an incoming webhook triggered from an external application? I couldn't find any setInterval api calls.
I think you have a fundamental misunderstanding of what a webhook is. It doesn't have anything to do with websockets or setInterval, it's just an HTTP endpoint that an external service can send a JSON message to that is processed by teams and results in a message being posted to the appropriate teams channel.
Displaying that message is the only part of that process that happens on the client where you could potentially be able to see the code involved.