Reverse a stack using recursion

Hey friends , Can anyone answer me how the recursive calls are done on this code , I am new to programming and don’t know much about recursion .

#include<bits/stdc++.h>
using namespace std;

void insert(stack &s , int temp )
{
if (s.size() == 0)
{
s.push(temp);
return;
}
int ele = s.top();
s.pop();
insert(s, temp);
s.push(ele);
return ;
}

void reverse(stack&s)
{
if (s.size() == 1)
return ;
int temp = s.top();
s.pop();
reverse(s);
insert(s , temp );
return;

}
int main ()
{
#ifndef ONLINE_JUDGE
//for getting input from input.txt
freopen(“input.txt”, “r”, stdin);

//for writing output to ouput.txt
freopen("output.txt", "w", stdout);

#endif
int t;
cin >> t ;
while (t–)
{
int n , ele, k;
cin >> n ;
stack s1 ;
stack s ;

	for (int i = 0 ; i < n ; i++)
	{
		cin >> ele ;
		s1.push(ele);
	}
	for (int i = 0 ; i < n ; i++)
	{
		int k = s1.top();
		s.push(k);
		s1.pop();
	}
	reverse(s);
	while ( !s.empty())
	{
		int x = s.top();
		cout << x << " ";
		s.pop();
	}


}
return 0 ;

}