Cognitive functioning is associated with various factors, such as age, sex, education, and childhood adversity, and is impaired in people with psychosis. In addition to specific effects of the disorder, cognitive impairments may reflect a greater exposure to general risk factors for poor cognition. To determine the extent that impairments in cognition in psychosis reflect risk factor exposures. This cross-sectional study examined the relationship between exposures and cognitive function using data from the Bipolar-Schizophrenia Network on Intermediate Phenotypes studies 1 and 2 across 6 sites. Participants included healthy controls; patients with schizophrenia, schizoaffective disorder, or bipolar I disorder with psychosis; and relatives of patients. Predictive modeling was performed using extreme gradient boosting regression to train a composite cognitive score prediction model with nested cross-validation. Shapley additive explanations values were used to examine the relationship between exposures and cognitive function. Exposures were chosen based on associations with cognition previously identified: age, sex, race and ethnicity, childhood adversity, education, parental education, parental socioeconomic status, parental age at birth, substance use, antipsychotic dose, and diagnosis. Cognition was assessed using the Brief Assessment of Cognition in Schizophrenia. A total of 3370 participants were included: 840 healthy controls, 709 patients with schizophrenia, 541 with schizoaffective disorder, 457 with bipolar I disorder with psychosis, and 823 relatives of patients. The mean (SD) age was 37.9 (13.3) years; 1887 were female (56%) and 1483 male (44%). The model predicted cognitive scores with high accuracy: out-of-sample Pearson correlation between predicted and observed cognitive composite score was r = 0.72 (SD = 0.03). Individuals with schizophrenia (z = -1.4), schizoaffective disorder (z = -1.2), and bipolar I disorder with psychosis (z = -0.5) all had significantly worse cognitive composite scores than controls. Factors other than diagnosis and medication accounted for much of this impairment (schizophrenia z = -0.73, schizoaffective disorder z = -0.64, bipolar I disorder with psychosis z = -0.13). Diagnosis accounted for a lesser proportion of this deficit (schizophrenia z = -0.29, schizoaffective disorder z = -0.15, bipolar I disorder with psychosis z = -0.13), and antipsychotic use accounted for a similar deficit across diagnostic groups (schizophrenia z = -0.37, schizoaffective disorder z = -0.33, bipolar I disorder with psychosis z = -0.26). This study found that transdiagnostic factors accounted for a meaningful share of the variance in cognitive functioning in psychosis. A significant proportion of the cognitive impairment in psychosis may reflect factors relevant to cognitive functioning in the general population. When considering interventions, a diagnosis-agnostic, symptom-targeted approach may therefore be appropriate.