When creating or editing a project if you don't specify a project ID, one will be created automatically based on the first letters of the project name. You can change it whenever you wish to by editing the project settings.
When creating a task you will notice that a task ID will be created automatically based on the project ID. The only way to change a task ID is to change the project ID. When moving the task to a different project, the task ID will be changed based on the new project ID. Task IDs are incremental and unique for that project.