The webinterface has been developped internally by a developped and use a mix of SQL and WMI to query SCCM and create deployments.
But I can't tell you more, it's not developped by us directly ;-)
While moving from package to application, we checked to use cmdlets instead to have a more clean / understandable code than using WMI.
The CI_ID change everytime you doing a modification on a Deployment Type :
PS CAS:\> Get-CMApplication -Name "Mozilla Firefox*" | Select LocalizedDisplayName, CI_ID, CI_UniqueID
LocalizedDisplayName : Mozilla Firefox EN (x64)
CI_ID : 591598
CI_UniqueID : ScopeId_8FEC0891-D7B7-4154-983C-C2D483509B8B/Application_ea836113-9216-4baf-b8b5-f9a80699a8e3/14
PS CAS:\> Set-CMScriptDeploymentType -ApplicationId 591598 -DeploymentTypeName "Install Mozilla Firefox EN (x64)" -NewName "Install Mozilla Firefox EN (x64) 2"
PS CAS:\> Get-CMApplication -Name "Mozilla Firefox*" | Select LocalizedDisplayName, CI_ID, CI_UniqueID
LocalizedDisplayName : Mozilla Firefox EN (x64)
CI_ID : 591607
CI_UniqueID :ScopeId_8FEC0891-D7B7-4154-983C-C2D483509B8B/Application_ea836113-9216-4baf-b8b5-f9a80699a8e3/15
So the CI_UniqueID stay the same (except the revision number) but the CI_ID change