Inclusion Criteria  Has histologically or cytologically confirmed diagnosis of locally advanced unresectable or metastatic gastric or gastroesophageal junction (GEJ) adenocarcinoma with known programmed cell death ligand 1 (PD-L1) expression status Has human epidermal growth factor receptor 2 (HER2) negative cancer Male participants must agree to use contraception during the intervention period and for at least 95 days after the last dose of chemotherapy, refrain from donating sperm and be abstinent from heterosexual intercourse as their preferred and usual lifestyle and agree to remain abstinent or must agree to use contraception per study protocol unless confirmed to be azoospermic during this period Female participants who are not pregnant, not breastfeeding, and at least one of the following conditions applies: not a woman of childbearing potential (WOCBP) OR is a WOCBP who agrees to use contraception or be abstinent from heterosexual intercourse as their preferred and usual lifestyle during the treatment period and for at least 180 days after the last dose of chemotherapy or for at least 120 days after the last dose of pembrolizumab, whichever is last, and agrees not to donate eggs to others or freeze/store for her own use for the purpose of reproduction during this period Has measurable disease per Response Evaluation Criteria in Solid Tumors version 1.1 (RECIST 1.1) as assessed by investigator assessment Has provided archival tumor tissue sample or newly obtained core or excisional biopsy of a tumor lesion not previously irradiated Has provided tumor tissue sample deemed adequate for PD-L1 biomarker analysis Has provided tumor tissue sample for microsatellite instability (MSI) biomarker analysis Has an Eastern Cooperative Oncology Group (ECOG) performance status of 0 or 1 within 3 days prior to the start of study intervention Has adequate organ function as demonstrated by laboratory testing within 10 days prior to the start of study treatment  Exclusion Criteria  Has squamous cell or undifferentiated gastric cancer Has had major surgery, open biopsy, or significant traumatic injury within 28 days prior to randomization, anticipation of the need for major surgery during the course of study intervention, or has not recovered adequately from the toxicity and/or complications from previous surgery Has preexisting peripheral neuropathy >Grade 1 Is a WOCBP who has a positive urine pregnancy test within 72 hours prior to randomization or treatment allocation Has had previous therapy for locally advanced, unresectable or metastatic gastric/GEJ cancer. Participants may have received prior neoadjuvant and/or adjuvant therapy as long as it was completed ≥6 months prior to randomization Has received prior therapy with an anti-PD-1, anti-PD-L1 or anti- PD-L2 agent or with an agent directed to another stimulatory or coinhibitory T-cell receptor (e.g., cytotoxic T-lymphocyte-associated protein 4 (CTLA-4), OX- 40, CD137) Has received prior systemic anticancer therapy including investigational agents within 4 weeks prior to randomization or has not recovered from all AEs due to any previous therapies to ≤Grade 1 or baseline Has received prior radiotherapy within 2 weeks prior to study start or has not recovered from all previous radiation-related toxicities, required corticosteroids, and have not had radiation pneumonitis. A 1-week washout is permitted for palliative radiation (≤2 weeks of radiotherapy) to noncentral nervous system (CNS) disease Has received a live or live-attenuated vaccine within 30 days prior to the first dose of study treatment Is currently participating in or has participated in a study of an investigational agent or has used an investigational device within 4 weeks prior to the first dose of study treatment Has a diagnosis of immunodeficiency or is receiving chronic systemic steroid therapy or any other form of immunosuppressive therapy within 7 days prior to the first dose of study treatment Has a known additional malignancy that is progressing or has required active treatment within the past 5 years with the exception of basal cell carcinoma of the skin, squamous cell carcinoma of the skin, or carcinoma in situ (eg, breast carcinoma, cervical cancer in situ) that have undergone potentially curative therapy Has known active CNS metastases and/or carcinomatous meningitis Has severe hypersensitivity (≥Grade 3) to pembrolizumab and/or any of its excipients Has an active autoimmune disease that has required systemic treatment in past 2 years Has a history of (non-infectious) pneumonitis that required steroids or has current pneumonitis Has an active infection requiring systemic therapy Has a known history of human immunodeficiency virus (HIV) infection Has a known history of Hepatitis B (defined as Hepatitis B surface antigen [HBsAg] reactive) or known active Hepatitis C virus (defined as Hepatitis C virus [HCV] ribonucleic acid [RNA] detected qualitatively) infection Has a known history of active tuberculosis Has hypokalemia (serum potassium less than the lower limit of normal) Has hypomagnesemia (serum magnesium less than the lower limit of normal) Has hypocalcemia (serum calcium less than the lower limit of normal) Has a history or current evidence of any condition (eg, known deficiency of the enzyme dihydropyrimidine dehydrogenase), therapy, or laboratory abnormality that might confound the results of the study, interfere with the participant's participation for the full duration of the study, or is not in the best interest of the participant to participate, in the opinion of the treating investigator Has a known psychiatric or substance abuse disorder that would interfere with the participant's ability to cooperate with the requirements of the study Is pregnant or breastfeeding or expecting to conceive or father children within the projected duration of the study, starting with the screening visit through 180 days after the last dose of chemotherapy or through 120 days after the last dose of pembrolizumab, whichever is last Has had an allogenic tissue/solid organ transplant Has a known severe hypersensitivity (≥ Grade 3) to any of the study chemotherapy agents (including, but not limited to, infusional 5-fluorouracil or oral capecitabine) and/or to any of their excipients For participants taking cisplatin: has Grade ≥2 audiometric hearing loss