Unreviewed analysis of the current behavior of the UniversalLanguageSelector and ContentTranslation extensions.
PlantUML source code:

@startuml
start
split
	group mw.uls.getFrequentLanguageList
		:ulsFrequentLanguages = [
			wgUserLanguage,
			wgContentLanguage,
			window.navigator.language or window.navigator.userLanguage,
			ULS previously used languages,
			wgULSAcceptLanguageList or window.navigator.languages,
			geolocated country languages,
		];
		:Clean list to only include
		valid and supported languages;
	end group
split again
	group siteMapper.getLanguagePairs
		:{targetLanguages, sourceLanguages} =
			get /list/languagepairs from CX service;
	end group
end split
group CXDashboard
	:filter possible target and source languages
	by ulsFrequentLanguages
	and filter to targets which are also in sources;
	split
		if (URL query "to"?) then (yes)
			:targetLanguage = query.to;
		(no) elseif (stored targetLanguage?) then (yes)
			:targetLanguage = stored targetLanguage;
		else (no)
		endif
		if (targetLanguage in targetLanguages) then (no)
			:targetLanguage = wgContentLanguage;
		else (yes)
		endif
	split again
		if (URL query "from"?) then (yes)
			:sourceLanguage = query.from;
		(no) elseif (stored sourceLanguage?) then (yes)
			:sourceLanguage = stored sourceLanguage;
		else (no)
		endif
	end split
	if (sourceLanguage valid?) then (no)
	  :sourceLanguage = first sourceLanguages != targetLanguage;
  else (yes)
	endif
	if (targetLanguage valid?) then (no)
	  :targetLanguage = first targetLanguages != sourceLanguage;
  else (yes)
	endif
	:store default source and target language;
end group
stop
@enduml
Own work
Adamw