I am working through the C++ guide from cplusplus.com. I do not really understand the following code (esepcially the emboldened code). What exactly is the emboldened section doing?

please could someone walk me through what the int main () is doing with the function and what the function does.

This is what I understand:
1) variable a is defined as a char and assigned value x
2) vaiable b is defined as int and assigned value 1602
3) increase (&a, sizeof(a)) assigns &a to data and 1 to psize (as char = 1)
4) the function defines a pointer variable pchar
5) pchar = (char*)data - this line is the most confusing. Firstly what is it doing. second, why could it not read char*data?
6)++(*pchar) increases the location that pchar points to by 1

Code:
 #include <iostream> 
using namespace std; 
 
void increase (void* data, int psize) 
{ 
 if ( psize == sizeof(char) ) 
 { 
     char* pchar; 
     pchar= (char*)data; 
     ++(*pchar); 
 } 
 else if (psize == sizeof(int) ) 
 { 
     int* pint; 
     pint=(int*)data; 
     ++(*pint); 
 } 
} 
 
int main () 
{ 
 char a = 'x'; 
 int b = 1602; 
 increase (&a,sizeof(a)); 
 increase (&b,sizeof(b)); 
 cout << a << ", " << b << endl; 
 return 0; 
}