pyWorkPage is a is something which holds all your case related case like page,page list information,routing information, step and stage information etc.when the case is intialized pyWorkPage is created automatically by the system along with your case data.
In general for creation of Case two ways will be there. Firstly it might be created using New Work drop down menu or it might be created programetically using an activity. If it is created using the New Work menu, then an activity named New is called. If you just get into the activity code, another activity named createWorkPage . That one takes work page name as parameter. If nothing is passed for this parameter, then the default value is also pyWorkPage. If we create the work page programmatically, then from the activity we generally call createWorkPage first directly then call add. So, while creating a case, then createWorkPage is typically the place where pyWorkPage is created. Technically whenever an work object is opened on the clipboard for processing it creates pyWorkPage as well.